X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/99fda03aa3c7f3ea80581b1d1ab62e709d46317e..8e33de15b5d050e5c3a781e6f1ec059405f72c9b:/include/wx/log.h diff --git a/include/wx/log.h b/include/wx/log.h index 254df43702..98dbd4938b 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -14,6 +14,8 @@ #include "wx/defs.h" +#include "wx/thread.h" + // ---------------------------------------------------------------------------- // common constants for use in wxUSE_LOG/!wxUSE_LOG // ---------------------------------------------------------------------------- @@ -301,20 +303,22 @@ protected: #define wxSUPPRESS_DOLOGSTRING_HIDE_WARNING() #endif - // log a line containing the number of times the previous message was - // repeated - // returns: the number - static unsigned DoLogNumberOfRepeats(); + // log a message indicating the number of times the previous message was + // repeated if ms_prevCounter > 0, does nothing otherwise; return the old + // value of ms_prevCounter + static unsigned LogLastRepetitionCountIfNeeded(); private: // static variables // ---------------- - // traditional behaviour or counting repetitions + // if true, don't log the same message multiple times, only log it once + // with the number of times it was repeated static bool ms_bRepetCounting; + + wxCRIT_SECT_DECLARE(ms_prevCS); // protects the ms_prev values below static wxString ms_prevString; // previous message that was logged - // how many times the previous message was logged - static unsigned ms_prevCounter; + static unsigned ms_prevCounter; // how many times it was repeated static time_t ms_prevTimeStamp;// timestamp of the previous message static wxLogLevel ms_prevLevel; // level of the previous message