]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/log.cpp
fixing the shrinking embedded controls
[wxWidgets.git] / src / common / log.cpp
index a42d6aaf893cbb268476fe5e78502cbcbea05770..e6690b652a6be8f489b95e50266c80982c36bdb2 100644 (file)
 // ----------------------------------------------------------------------------
 
 // generic log function
-void wxVLogGeneric(wxLogLevel level, const wxChar *szFormat, va_list argptr)
+void wxVLogGeneric(wxLogLevel level, const wxString& format, va_list argptr)
 {
     if ( wxLog::IsEnabled() ) {
-        wxLog::OnLog(level, wxString::FormatV(szFormat, argptr), time(NULL));
+        wxLog::OnLog(level, wxString::FormatV(format, argptr), time(NULL));
     }
 }
 
-void wxLogGeneric(wxLogLevel level, const wxChar *szFormat, ...)
+void wxDoLogGeneric(wxLogLevel level, const wxChar *szFormat, ...)
 {
     va_list argptr;
     va_start(argptr, szFormat);
@@ -100,15 +100,15 @@ void wxLogGeneric(wxLogLevel level, const wxChar *szFormat, ...)
 }
 
 #define IMPLEMENT_LOG_FUNCTION(level)                               \
-  void wxVLog##level(const wxChar *szFormat, va_list argptr)        \
+  void wxVLog##level(const wxString& format, va_list argptr)        \
   {                                                                 \
     if ( wxLog::IsEnabled() ) {                                     \
       wxLog::OnLog(wxLOG_##level,                                   \
-                   wxString::FormatV(szFormat, argptr), time(NULL));\
+                   wxString::FormatV(format, argptr), time(NULL));  \
     }                                                               \
   }                                                                 \
                                                                     \
-  void wxLog##level(const wxChar *szFormat, ...)                    \
+  void wxDoLog##level(const wxChar *szFormat, ...)                  \
   {                                                                 \
     va_list argptr;                                                 \
     va_start(argptr, szFormat);                                     \
@@ -134,9 +134,9 @@ void wxSafeShowMessage(const wxString& title, const wxString& text)
 
 // fatal errors can't be suppressed nor handled by the custom log target and
 // always terminate the program
-void wxVLogFatalError(const wxChar *szFormat, va_list argptr)
+void wxVLogFatalError(const wxString& format, va_list argptr)
 {
-    wxSafeShowMessage(_T("Fatal Error"), wxString::FormatV(szFormat, argptr));
+    wxSafeShowMessage(_T("Fatal Error"), wxString::FormatV(format, argptr));
 
 #ifdef __WXWINCE__
     ExitThread(3);
@@ -145,7 +145,7 @@ void wxVLogFatalError(const wxChar *szFormat, va_list argptr)
 #endif
 }
 
-void wxLogFatalError(const wxChar *szFormat, ...)
+void wxDoLogFatalError(const wxChar *szFormat, ...)
 {
     va_list argptr;
     va_start(argptr, szFormat);
@@ -157,17 +157,17 @@ void wxLogFatalError(const wxChar *szFormat, ...)
 }
 
 // same as info, but only if 'verbose' mode is on
-void wxVLogVerbose(const wxChar *szFormat, va_list argptr)
+void wxVLogVerbose(const wxString& format, va_list argptr)
 {
     if ( wxLog::IsEnabled() ) {
         if ( wxLog::GetActiveTarget() != NULL && wxLog::GetVerbose() ) {
             wxLog::OnLog(wxLOG_Info,
-                         wxString::FormatV(szFormat, argptr), time(NULL));
+                         wxString::FormatV(format, argptr), time(NULL));
         }
     }
 }
 
-void wxLogVerbose(const wxChar *szFormat, ...)
+void wxDoLogVerbose(const wxChar *szFormat, ...)
 {
     va_list argptr;
     va_start(argptr, szFormat);
@@ -186,7 +186,7 @@ void wxLogVerbose(const wxChar *szFormat, ...)
     }                                                               \
   }                                                                 \
                                                                     \
-  void wxLog##level(const wxChar *szFormat, ...)                    \
+  void wxDoLog##level(const wxChar *szFormat, ...)                  \
   {                                                                 \
     va_list argptr;                                                 \
     va_start(argptr, szFormat);                                     \
@@ -194,17 +194,17 @@ void wxLogVerbose(const wxChar *szFormat, ...)
     va_end(argptr);                                                 \
   }
 
-  void wxVLogTrace(const wxChar *mask, const wxChar *szFormat, va_list argptr)
+  void wxVLogTrace(const wxString& mask, const wxString& format, va_list argptr)
   {
     if ( wxLog::IsEnabled() && wxLog::IsAllowedTraceMask(mask) ) {
       wxString msg;
-      msg << _T("(") << mask << _T(") ") << wxString::FormatV(szFormat, argptr);
-          
+      msg << _T("(") << mask << _T(") ") << wxString::FormatV(format, argptr);
+
       wxLog::OnLog(wxLOG_Trace, msg, time(NULL));
     }
   }
 
-  void wxLogTrace(const wxChar *mask, const wxChar *szFormat, ...)
+  void wxDoLogTrace(const wxString& mask, const wxChar *szFormat, ...)
   {
     va_list argptr;
     va_start(argptr, szFormat);
@@ -212,17 +212,17 @@ void wxLogVerbose(const wxChar *szFormat, ...)
     va_end(argptr);
   }
 
-  void wxVLogTrace(wxTraceMask mask, const wxChar *szFormat, va_list argptr)
+  void wxVLogTrace(wxTraceMask mask, const wxString& format, 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 ( wxLog::IsEnabled() && ((wxLog::GetTraceMask() & mask) == mask) ) {
-      wxLog::OnLog(wxLOG_Trace, wxString::FormatV(szFormat, argptr), time(NULL));
+      wxLog::OnLog(wxLOG_Trace, wxString::FormatV(format, argptr), time(NULL));
     }
   }
 
-  void wxLogTrace(wxTraceMask mask, const wxChar *szFormat, ...)
+  void wxDoLogTrace(wxTraceMask mask, const wxChar *szFormat, ...)
   {
     va_list argptr;
     va_start(argptr, szFormat);
@@ -246,12 +246,12 @@ static inline wxString wxLogSysErrorHelper(long err)
     return wxString::Format(_(" (error %ld: %s)"), err, wxSysErrorMsg(err));
 }
 
-void WXDLLEXPORT wxVLogSysError(const wxChar *szFormat, va_list argptr)
+void WXDLLEXPORT wxVLogSysError(const wxString& format, va_list argptr)
 {
-    wxVLogSysError(wxSysErrorCode(), szFormat, argptr);
+    wxVLogSysError(wxSysErrorCode(), format, argptr);
 }
 
-void WXDLLEXPORT wxLogSysError(const wxChar *szFormat, ...)
+void WXDLLEXPORT wxDoLogSysError(const wxChar *szFormat, ...)
 {
     va_list argptr;
     va_start(argptr, szFormat);
@@ -259,16 +259,16 @@ void WXDLLEXPORT wxLogSysError(const wxChar *szFormat, ...)
     va_end(argptr);
 }
 
-void WXDLLEXPORT wxVLogSysError(long err, const wxChar *fmt, va_list argptr)
+void WXDLLEXPORT wxVLogSysError(long err, const wxString& format, va_list argptr)
 {
     if ( wxLog::IsEnabled() ) {
         wxLog::OnLog(wxLOG_Error,
-                     wxString::FormatV(fmt, argptr) + wxLogSysErrorHelper(err),
+                     wxString::FormatV(format, argptr) + wxLogSysErrorHelper(err),
                      time(NULL));
     }
 }
 
-void WXDLLEXPORT wxLogSysError(long lErrCode, const wxChar *szFormat, ...)
+void WXDLLEXPORT wxDoLogSysError(long lErrCode, const wxChar *szFormat, ...)
 {
     va_list argptr;
     va_start(argptr, szFormat);
@@ -329,7 +329,7 @@ void wxLog::OnLog(wxLogLevel level, const wxChar *szString, time_t t)
             {
                 if ( GetRepetitionCounting() )
                 {
-                    pLogger->DoLogNumberOfRepeats();
+                    DoLogNumberOfRepeats();
                 }
                 ms_prevString = szString;
                 ms_prevLevel = level;