-IMPLEMENT_LOG_FUNCTION(Debug)
-IMPLEMENT_LOG_FUNCTION(Trace)
-
-void wxLogVerbose(wxTString strFormat, ...)
-{
- if ( wxLog::GetVerbose() && wxLog::GetActiveTarget() != NULL ) {
- va_list argptr;
- va_start(argptr, strFormat);
- vsprintf(s_szBuf, strFormat, argptr);
- va_end(argptr);
-
- wxLog::OnLog(wxLog::Info, s_szBuf);
- }
-}
-
-void wxLogSysError(wxTString str, ...)
-{
- if ( wxLog::GetActiveTarget() != NULL ) {
- va_list argptr;
- va_start(argptr, str);
- vsprintf(s_szBuf, str, argptr);
- va_end(argptr);
-
- char szErrMsg[LOG_BUFFER_SIZE / 2];
- sprintf(szErrMsg, _(" (error %ld: %s)"), wxSysErrorCode(), wxSysErrorMsg());
- strncat(s_szBuf, szErrMsg, WXSIZEOF(s_szBuf) - strlen(s_szBuf));
-
- wxLog::OnLog(wxLog::Error, s_szBuf);
+ void wxLogTrace(const wxChar *mask, const wxChar *szFormat, ...)
+ {
+ if ( IsLoggingEnabled() && wxLog::IsAllowedTraceMask(mask) ) {
+ wxCRIT_SECT_LOCKER(locker, gs_csLogBuf);
+
+ wxChar *p = s_szBuf;
+ size_t len = WXSIZEOF(s_szBuf);
+ 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;
+
+ va_list argptr;
+ va_start(argptr, szFormat);
+ wxVsnprintf(p, len, szFormat, argptr);
+ va_end(argptr);
+
+ wxLog::OnLog(wxLOG_Trace, s_szBuf, time(NULL));
+ }
+ }
+
+ void wxLogTrace(wxTraceMask mask, const wxChar *szFormat, ...)
+ {
+ // 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);
+
+ va_list argptr;
+ va_start(argptr, szFormat);
+ wxVsnprintf(s_szBuf, WXSIZEOF(s_szBuf), szFormat, argptr);
+ va_end(argptr);
+
+ wxLog::OnLog(wxLOG_Trace, s_szBuf, time(NULL));
+ }