-void wxLogGeneric(wxLog::Level level, wxTString strFormat, ...)
-{
- if ( wxLog::GetActiveTarget() != NULL ) {
- va_list argptr;
- va_start(argptr, strFormat);
- vsprintf(s_szBuf, strFormat, argptr);
- va_end(argptr);
-
- wxLog::OnLog(level, s_szBuf);
- }
-}
-
-#define IMPLEMENT_LOG_FUNCTION(level) \
- void wxLog##level(wxTString strFormat, ...) \
- { \
- if ( wxLog::GetActiveTarget() != NULL ) { \
- va_list argptr; \
- va_start(argptr, strFormat); \
- vsprintf(s_szBuf, strFormat, argptr); \
- va_end(argptr); \
- \
- wxLog::OnLog(wxLog::level, s_szBuf); \
- } \
+void wxVLogGeneric(wxLogLevel level, const wxChar *szFormat, va_list argptr)
+{
+ if ( wxLog::IsEnabled() ) {
+ wxCRIT_SECT_LOCKER(locker, gs_csLogBuf);
+
+ PrintfInLogBuf(szFormat, argptr);
+
+ wxLog::OnLog(level, s_szBuf, time(NULL));
+ }
+}
+
+void wxLogGeneric(wxLogLevel level, const wxChar *szFormat, ...)
+{
+ va_list argptr;
+ va_start(argptr, szFormat);
+ wxVLogGeneric(level, szFormat, argptr);
+ va_end(argptr);
+}
+
+#define IMPLEMENT_LOG_FUNCTION(level) \
+ void wxVLog##level(const wxChar *szFormat, va_list argptr) \
+ { \
+ if ( wxLog::IsEnabled() ) { \
+ wxCRIT_SECT_LOCKER(locker, gs_csLogBuf); \
+ \
+ PrintfInLogBuf(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); \