Ticket #14595 (closed defect: fixed)
Console application: Log messages from worker threads aren't displayed
| Reported by: | roed_bis | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | base | Version: | 2.9.4 |
| Keywords: | console wxLog mt | Cc: | |
| Blocked By: | Patch: | no | |
| Blocking: |
Description
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
Note: See
TracTickets for help on using
tickets.
