// wxLog class implementation
// ----------------------------------------------------------------------------
-unsigned wxLog::LogLastRepetitionCountIfNeeded()
+unsigned wxLog::LogLastRepeatIfNeeded()
{
wxCRIT_SECT_LOCKER(lock, ms_prevCS);
+ return LogLastRepeatIfNeededUnlocked();
+}
+
+unsigned wxLog::LogLastRepeatIfNeededUnlocked()
+{
const unsigned count = ms_prevCounter;
if ( ms_prevCounter )
wxLog::~wxLog()
{
- LogLastRepetitionCountIfNeeded();
+ // Flush() must be called before destroying the object as otherwise some
+ // messages could be lost
+ if ( ms_prevCounter )
+ {
+ wxMessageOutputDebug().Printf
+ (
+ wxS("Last repeated message (\"%s\", %lu times) wasn't output"),
+ ms_prevString,
+ ms_prevCounter
+ );
+ }
}
/* static */
return;
}
- pLogger->LogLastRepetitionCountIfNeeded();
+ pLogger->LogLastRepeatIfNeededUnlocked();
// reset repetition counter for a new message
ms_prevString = szString;
void wxLog::Flush()
{
- // nothing to do here
+ LogLastRepeatIfNeeded();
}
/*static*/ bool wxLog::IsAllowedTraceMask(const wxString& mask)