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?
Change History (5)
comment:1 follow-up: ↓ 2 Changed 4 years ago by vadz
- Keywords wxLog mt added
- Priority changed from lowest to low
- Status changed from new to confirmed