#pragma interface "log.h"
#endif
+// ----------------------------------------------------------------------------
+// forward declarations
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxTextCtrl;
+class WXDLLEXPORT wxLogFrame;
+class WXDLLEXPORT wxFrame;
+
+// ----------------------------------------------------------------------------
+// types
+// ----------------------------------------------------------------------------
+
+typedef unsigned long wxTraceMask;
+typedef unsigned long wxLogLevel;
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
#if wxUSE_LOG
#include <time.h> // for time_t
#define wxTraceOleCalls 0x0100 // OLE interface calls
#endif
-typedef unsigned long wxTraceMask;
-typedef unsigned long wxLogLevel;
-
-// ----------------------------------------------------------------------------
-// forward declarations
-// ----------------------------------------------------------------------------
-
-class WXDLLEXPORT wxTextCtrl;
-class WXDLLEXPORT wxLogFrame;
-class WXDLLEXPORT wxFrame;
-
#if wxUSE_IOSTREAMH
// N.B. BC++ doesn't have istream.h, ostream.h
# include <iostream.h>
// log functions do nothing at all
#define DECLARE_LOG_FUNCTION(level) \
-inline void WXDLLEXPORT wxLog##level(const wxChar * WXUNUSED(szFormat), ...) {}
+inline void WXDLLEXPORT wxLog##level(const wxChar *szFormat, ...) {}
#define DECLARE_LOG_FUNCTION2(level, arg1) \
-inline void WXDLLEXPORT wxLog##level(WXUNUSED(arg1), \
- const wxChar *WXUNUSED(szFormat), ...) {}
+inline void WXDLLEXPORT wxLog##level(arg1, const wxChar *szFormat, ...) {}
#endif // wxUSE_LOG/!wxUSE_LOG
{
//// COMMON CLEANUP
+#if wxUSE_LOG
// flush the logged messages if any and install a 'safer' log target: the
// default one (wxLogGui) can't be used after the resources are freed just
// below and the user suppliedo ne might be even more unsafe (using any
// this will flush the old messages if any
delete wxLog::SetActiveTarget(new wxLogStderr);
+#endif // wxUSE_LOG
// One last chance for pending objects to be cleaned up
wxTheApp->DeletePendingObjects();
// wxDebugContext::SetStream(NULL, NULL);
#endif
+#if wxUSE_LOG
// do it as the very last thing because everything else can log messages
delete wxLog::SetActiveTarget(NULL);
+#endif // wxUSE_LOG
}
#if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
// 'Garbage' collection of windows deleted with Close().
DeletePendingObjects();
+#if wxUSE_LOG
// flush the logged messages if any
wxLog *pLog = wxLog::GetActiveTarget();
if ( pLog != NULL && pLog->HasPendingMessages() )
pLog->Flush();
+#endif // wxUSE_LOG
// Send OnIdle events to all windows
if ( SendIdleEvents() )