diff --git a/include/wx/log.h b/include/wx/log.h index 00b4cdd1d1..0c178347d9 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -69,7 +69,13 @@ public: // sink function static void OnLog(wxLogLevel level, const char *szString) - { if ( ms_pLogger != 0 ) ms_pLogger->DoLog(level, szString); } + { + wxLog *pLogger = GetActiveTarget(); + if ( pLogger ) + { + pLogger->DoLog(level, szString); + } + } // message buffering // flush shows all messages if they're not logged immediately