/////////////////////////////////////////////////////////////////////////////
-// Name: log.h
+// Name: wx/log.h
// Purpose: Assorted wxLogXXX functions, and wxLog (sink for logs)
// Author: Vadim Zeitlin
// Modified by:
#endif // wxUSE_STD_IOSTREAM
-// the following log targets are only compiled in if the we're compiling the
-// GUI part (andnot just the base one) of the library, they're implemented in
-// src/generic/logg.cpp *and not src/common/log.cpp unlike all the rest)
-
-#if wxUSE_GUI
-
-#if wxUSE_TEXTCTRL
-
-// log everything to a text window (GUI only of course)
-class WXDLLEXPORT wxLogTextCtrl : public wxLog
-{
-public:
- wxLogTextCtrl(wxTextCtrl *pTextCtrl);
-
-private:
- // implement sink function
- virtual void DoLogString(const wxChar *szString, time_t t);
-
- // the control we use
- wxTextCtrl *m_pTextCtrl;
-};
-
-#endif // wxUSE_TEXTCTRL
-
// ----------------------------------------------------------------------------
// /dev/null log target: suppress logging until this object goes out of scope
// ----------------------------------------------------------------------------
wxLogPassThrough();
};
+// ----------------------------------------------------------------------------
+// the following log targets are only compiled in if the we're compiling the
+// GUI part (andnot just the base one) of the library, they're implemented in
+// src/generic/logg.cpp *and not src/common/log.cpp unlike all the rest)
+// ----------------------------------------------------------------------------
+
+#if wxUSE_GUI
+
+#if wxUSE_TEXTCTRL
+
+// log everything to a text window (GUI only of course)
+class WXDLLEXPORT wxLogTextCtrl : public wxLog
+{
+public:
+ wxLogTextCtrl(wxTextCtrl *pTextCtrl);
+
+private:
+ // implement sink function
+ virtual void DoLogString(const wxChar *szString, time_t t);
+
+ // the control we use
+ wxTextCtrl *m_pTextCtrl;
+};
+
+#endif // wxUSE_TEXTCTRL
+
// ----------------------------------------------------------------------------
// GUI log target, the default one for wxWindows programs
// ----------------------------------------------------------------------------
// -------------------
#define DECLARE_LOG_FUNCTION(level) \
+extern void WXDLLEXPORT wxVLog##level(const wxChar *szFormat, \
+ va_list argptr); \
extern void WXDLLEXPORT wxLog##level(const wxChar *szFormat, ...)
#define DECLARE_LOG_FUNCTION2(level, arg1) \
+extern void WXDLLEXPORT wxVLog##level(arg1, const wxChar *szFormat, \
+ va_list argptr); \
extern void WXDLLEXPORT wxLog##level(arg1, const wxChar *szFormat, ...)
#else // !wxUSE_LOG
// log functions do nothing at all
#define DECLARE_LOG_FUNCTION(level) \
+inline void WXDLLEXPORT wxVLog##level(const wxChar *szFormat, \
+ va_list argptr) {} \
inline void WXDLLEXPORT wxLog##level(const wxChar *szFormat, ...) {}
#define DECLARE_LOG_FUNCTION2(level, arg1) \
+inline void WXDLLEXPORT wxVLog##level(arg1, const wxChar *szFormat, \
+ va_list argptr) {} \
inline void WXDLLEXPORT wxLog##level(arg1, const wxChar *szFormat, ...) {}
#endif // wxUSE_LOG/!wxUSE_LOG
#ifdef __WXDEBUG__
DECLARE_LOG_FUNCTION(Debug);
- // first king of LogTrace is uncoditional: it doesn't check the level,
+ // first kind of LogTrace is unconditional: it doesn't check the level,
DECLARE_LOG_FUNCTION(Trace);
// this second version will only log the message if the mask had been
DECLARE_LOG_FUNCTION2(Trace, wxTraceMask mask);
#else //!debug
// these functions do nothing in release builds
+ inline void wxVLogDebug(const wxChar *, va_list) { }
inline void wxLogDebug(const wxChar *, ...) { }
+ inline void wxVLogTrace(const wxChar *, va_list) { }
inline void wxLogTrace(const wxChar *, ...) { }
+ inline void wxVLogTrace(wxTraceMask, const wxChar *, va_list) { }
inline void wxLogTrace(wxTraceMask, const wxChar *, ...) { }
+ inline void wxVLogTrace(const wxChar *, const wxChar *, va_list) { }
inline void wxLogTrace(const wxChar *, const wxChar *, ...) { }
#endif // debug/!debug
// debug only logging functions: use them with API name and error code
// ----------------------------------------------------------------------------
-#ifndef __TFILE__
- #define __XFILE__(x) Tx)
- #define __TFILE__ __XFILE__(__FILE__)
-#endif
-
#ifdef __WXDEBUG__
// make life easier for people using VC++ IDE: clicking on the message
// will take us immediately to the place of the failed API