-#define IMPLEMENT_LOG_DEBUG_FUNCTION(level) \
- void wxLog##level(const wxChar *szFormat, ...) \
- { \
- if ( wxLog::GetActiveTarget() != NULL ) { \
- 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_##level, s_szBuf, time(NULL)); \
- } \
+#define IMPLEMENT_LOG_DEBUG_FUNCTION(level) \
+ void wxLog##level(const wxChar *szFormat, ...) \
+ { \
+ if ( IsLoggingEnabled() ) { \
+ 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_##level, s_szBuf, time(NULL)); \
+ } \