TypeError: LogInfo(): argument 1 has unexpected type 'str'

I have an app that I want to replace print statements with wx.Log (wx.LogError(), wx.LogDebug(), …)

In my frame __init__() I instantiate a log window.

        self.log_window = wx.LogWindow( None, 'Log Window', show=True )

and in an event handler I have a simple test log statement.

        wx.LogInfo( f"xxxxxxxxx" )

When called I get the following error:

TypeError: LogInfo(): argument 1 has unexpected type 'str'

What am I doing wrong? The docs aren’t overly clear and I can’t find any good examples online or in wxdemo on how to use the logging system.

wx.LogError() does seem to work. A dialog is displayed with the message.

        wx.LogError( f"xxxxxxxxx" )

What I am after is something that mimics python’s logging, but will output to a log window instead of the terminal. This includes errors (e.g. logger.error("blah blah") should output the log window (console) and not necessarily pop up a dialog.

Thanks, Brendan.