When I read the WxWidgets documentation, I get the impression that the developers wrote it just for themselves, just to remember what they did 20 years ago.
Regardless, I figured out how to send log messages to a file:
wxLog::SetActiveTarget(new wxLogStderr(fopen(logPath + "/wxApp.log", "w + ")));
and also I figured out how to change the format of the log messages:
wxLog::GetActiveTarget()->SetFormatter(new MyLogger);
But I didn't understand anything else.
So I want to ask my question here.
I want to make a log for my application.
Moreover, I want:
- all log messages to be written to a file
- at the same time some of these messages are displayed on the screen using wxTextCtrl.
So I want to filter the log messages that are displayed on the screen, depending on the logging level:
for example, I want to display in wxTextCtrl only log messages with "wxLOG_Info" and "wxLOG_Error" levels.
How can this be done in Windows and Linux in C++? It's best to show a code example.