Ticket #14595 (closed defect: fixed)
Console application: Log messages from worker threads aren't displayed
|Reported by:||roed_bis||Owned by:|
|Keywords:||console wxLog mt||Cc:|
In GUI applications log messages from from worker threads are queued and displayed at idle time but in console application there's no message loop so queue will never be flushed.
Maybe this is not a bug but at minimum documentation needs clarification.
A simple workaround is to create separate log object in a worker thread:
wxLogStderr log; wxLog::SetThreadActiveTarget( &log );
I don't know is there an elegant way to distinguish between console and GUI application at runtime. Maybe application traits? HasStderr or CanUseStderr function?