// wxLog class implementation
// ----------------------------------------------------------------------------
-/* static */
-void wxLog::LogLastRepetitionCountIfNeeded()
+unsigned wxLog::LogLastRepetitionCountIfNeeded()
{
wxCRIT_SECT_LOCKER(lock, ms_prevCS);
- wxLog *pLogger = GetActiveTarget();
- if ( pLogger && ms_prevCounter )
+ const unsigned count = ms_prevCounter;
+
+ if ( ms_prevCounter )
{
wxString msg;
#if wxUSE_INTL
#endif
ms_prevCounter = 0;
ms_prevString.clear();
- pLogger->DoLog(ms_prevLevel, msg, ms_prevTimeStamp);
+ DoLog(ms_prevLevel, msg, ms_prevTimeStamp);
}
+
+ return count;
}
wxLog::~wxLog()
return;
}
- LogLastRepetitionCountIfNeeded();
+ pLogger->LogLastRepetitionCountIfNeeded();
// reset repetition counter for a new message
ms_prevString = szString;
// static variables
// ----------------------------------------------------------------------------
+#if wxUSE_THREADS
+wxCriticalSection wxLog::ms_prevCS;
+#endif // wxUSE_THREADS
bool wxLog::ms_bRepetCounting = false;
wxString wxLog::ms_prevString;
unsigned int wxLog::ms_prevCounter = 0;