// ----------------------------------------------------------------------------
// generic log function
-void wxLogGeneric(wxLogLevel level, const wxChar *szFormat, ...)
+void wxVLogGeneric(wxLogLevel level, const wxChar *szFormat, va_list argptr)
{
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(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 wxLog##level(const wxChar *szFormat, ...) \
+ void wxVLog##level(const wxChar *szFormat, va_list argptr) \
{ \
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)); \
} \
+ } \
+ void wxLog##level(const wxChar *szFormat, ...) \
+ { \
+ va_list argptr; \
+ va_start(argptr, szFormat); \
+ wxVLog##level(szFormat, argptr); \
+ va_end(argptr); \
}
IMPLEMENT_LOG_FUNCTION(FatalError)
IMPLEMENT_LOG_FUNCTION(Status)
// same as info, but only if 'verbose' mode is on
-void wxLogVerbose(const wxChar *szFormat, ...)
+void wxVLogVerbose(const wxChar *szFormat, va_list argptr)
{
if ( IsLoggingEnabled() ) {
wxLog *pLog = wxLog::GetActiveTarget();
if ( pLog != NULL && pLog->GetVerbose() ) {
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_Info, s_szBuf, time(NULL));
}
}
}
+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 wxLog##level(const wxChar *szFormat, ...) \
+ void wxVLog##level(const wxChar *szFormat, va_list argptr) \
{ \
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)); \
} \
+ } \
+ void wxLog##level(const wxChar *szFormat, ...) \
+ { \
+ va_list argptr; \
+ va_start(argptr, szFormat); \
+ wxVLog##level(szFormat, argptr); \
+ va_end(argptr); \
}
- void wxLogTrace(const wxChar *mask, const wxChar *szFormat, ...)
+ void wxVLogTrace(const wxChar *mask, const wxChar *szFormat, va_list argptr)
{
if ( IsLoggingEnabled() && wxLog::IsAllowedTraceMask(mask) ) {
wxCRIT_SECT_LOCKER(locker, gs_csLogBuf);
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, ...)
+ 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 ( 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));
}
}
+ void wxLogTrace(wxTraceMask mask, const wxChar *szFormat, ...)
+ {
+ va_list argptr;
+ va_start(argptr, szFormat);
+ wxVLogTrace(mask, szFormat, argptr);
+ va_end(argptr);
+ }
+
#else // release
#define IMPLEMENT_LOG_DEBUG_FUNCTION(level)
#endif
wxLog::OnLog(wxLOG_Error, s_szBuf, time(NULL));
}
-void WXDLLEXPORT wxLogSysError(const wxChar *szFormat, ...)
+void WXDLLEXPORT wxVLogSysError(const wxChar *szFormat, va_list argptr)
{
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);
wxLogSysErrorHelper(wxSysErrorCode());
}
}
-void WXDLLEXPORT wxLogSysError(long lErrCode, const wxChar *szFormat, ...)
+void WXDLLEXPORT wxLogSysError(const wxChar *szFormat, ...)
+{
+ va_list argptr;
+ va_start(argptr, szFormat);
+ wxVLogSysError(szFormat, argptr);
+ va_end(argptr);
+}
+
+void WXDLLEXPORT wxVLogSysError(long lErrCode, const wxChar *szFormat, va_list argptr)
{
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);
wxLogSysErrorHelper(lErrCode);
}
}
+void WXDLLEXPORT wxLogSysError(long lErrCode, const wxChar *szFormat, ...)
+{
+ va_list argptr;
+ va_start(argptr, szFormat);
+ wxVLogSysError(lErrCode, szFormat, argptr);
+ va_end(argptr);
+}
+
// ----------------------------------------------------------------------------
// wxLog class implementation
// ----------------------------------------------------------------------------
m_fp = fp;
}
-#if defined(__WXMAC__) && !defined(__DARWIN__)
+#if defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ > 0x5300)
+
+#if !TARGET_API_MAC_CARBON
+// MetroNub stuff doesn't seem to work in CodeWarrior 5.3 Carbon builds...
#ifndef __MetroNubUtils__
#include "MetroNubUtils.h"
}
#endif
-#endif
+#endif // !TARGET_API_MAC_CARBON
+
+#endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ > 0x5300)
void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
{
Boolean running = false ;
+#if !TARGET_API_MAC_CARBON && (__MWERKS__ > 0x5300)
+
if ( IsMWDebuggerRunning() && AmIBeingMWDebugged() )
{
running = true ;
}
+#endif
+
if (running)
{
#ifdef __powerc