-void wxLogVerbose(const wxChar *szFormat, ...)
-{
- va_list argptr;
- va_start(argptr, szFormat);
- wxVLogVerbose(szFormat, argptr);
- va_end(argptr);
-}
-
-// debug functions
-#ifdef __WXDEBUG__
-#define IMPLEMENT_LOG_DEBUG_FUNCTION(level) \
- void wxVLog##level(const wxChar *szFormat, va_list argptr) \
- { \
- if ( IsLoggingEnabled() ) { \
- wxCRIT_SECT_LOCKER(locker, gs_csLogBuf); \
- \
- wxVsnprintf(s_szBuf, s_szBufSize, szFormat, argptr); \
- \
- wxLog::OnLog(wxLOG_##level, s_szBuf, time(NULL)); \
- } \
- } \
- void wxLog##level(const wxChar *szFormat, ...) \
- { \
- va_list argptr; \
- va_start(argptr, szFormat); \
- wxVLog##level(szFormat, argptr); \
- va_end(argptr); \
- }
-
- void wxVLogTrace(const wxChar *mask, const wxChar *szFormat, va_list argptr)
- {
- if ( IsLoggingEnabled() && wxLog::IsAllowedTraceMask(mask) ) {
- wxCRIT_SECT_LOCKER(locker, gs_csLogBuf);
-
- wxChar *p = s_szBuf;
- size_t len = s_szBufSize;
- wxStrncpy(s_szBuf, _T("("), len);
- len -= 1; // strlen("(")
- p += 1;
- wxStrncat(p, mask, len);
- size_t lenMask = wxStrlen(mask);
- len -= lenMask;
- p += lenMask;
-
- wxStrncat(p, _T(") "), len);
- len -= 2;
- p += 2;
-
- wxVsnprintf(p, len, szFormat, argptr);
-
- wxLog::OnLog(wxLOG_Trace, s_szBuf, time(NULL));
- }
- }
-
- void wxLogTrace(const wxChar *mask, const wxChar *szFormat, ...)
- {
- va_list argptr;
- va_start(argptr, szFormat);
- wxVLogTrace(mask, szFormat, argptr);
- va_end(argptr);
- }
-
- void wxVLogTrace(wxTraceMask mask, const wxChar *szFormat, va_list argptr)
- {
- // we check that all of mask bits are set in the current mask, so
- // that wxLogTrace(wxTraceRefCount | wxTraceOle) will only do something
- // if both bits are set.
- if ( IsLoggingEnabled() && ((wxLog::GetTraceMask() & mask) == mask) ) {
- wxCRIT_SECT_LOCKER(locker, gs_csLogBuf);
-
- wxVsnprintf(s_szBuf, s_szBufSize, szFormat, argptr);
-
- wxLog::OnLog(wxLOG_Trace, s_szBuf, time(NULL));
+void
+wxLog::CallDoLogNow(wxLogLevel level,
+ const wxString& msg,
+ const wxLogRecordInfo& info)
+{
+ if ( GetRepetitionCounting() )
+ {
+ if ( msg == gs_prevLog.msg )
+ {
+ gs_prevLog.numRepeated++;
+
+ // nothing else to do, in particular, don't log the
+ // repeated message
+ return;
+ }
+
+ LogLastRepeatIfNeeded();
+
+ // reset repetition counter for a new message
+ gs_prevLog.msg = msg;
+ gs_prevLog.level = level;
+ gs_prevLog.info = info;