I’ve tried following solution, but it exited with “segmentation fault”.What’s the correct way of setting log formatter ?
wxPython version: 4.0.6
Python version: 3.7.5
class MyLogFormatter(wx.LogFormatter):
def Format(self, level, msg, info):
return "[%d] %s(%d) : %s" % (info.threadId, info.filename, info.line, msg)
if __name__ == "__main__":
app = wx.App()
frame = wx.Frame(None, title="hello")
frame.Show()
log = wx.LogStderr()
log.SetFormatter(MyLogFormatter())
wx.Log.SetActiveTarget(log)
wx.LogMessage('hello')
app.MainLoop()