Make wxLog::EnableLogging() and wxLogNull thread-specific.

Disabling logging in a single thread (even the main one) shouldn't disable
logs from the background threads which should disable their logging themselves
as/if needed.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-07-13 13:21:52 +00:00
parent acad886cb4
commit 53ff8df7d5
6 changed files with 68 additions and 6 deletions

View File

@@ -657,6 +657,20 @@ void wxLog::FlushThreadMessages()
}
}
/* static */
bool wxLog::IsThreadLoggingEnabled()
{
return !wxThreadInfo.loggingDisabled;
}
/* static */
bool wxLog::EnableThreadLogging(bool enable)
{
const bool wasEnabled = !wxThreadInfo.loggingDisabled;
wxThreadInfo.loggingDisabled = !enable;
return wasEnabled;
}
#endif // wxUSE_THREADS
void wxLog::Flush()