X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f562374f11048ff0005b7229683b3804d2208d2..6dbb903bb9410e2a2a977ad349ba7b4b3b12ac78:/include/wx/log.h diff --git a/include/wx/log.h b/include/wx/log.h index d7d62303dc..edbddebb63 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -103,6 +103,12 @@ public: // ctor wxLog(); + // Internal buffer. + // Allow replacement of the fixed size static buffer with + // a user allocated one. Pass in NULL to restore the + // built in static buffer. + static wxChar *SetLogBuffer( wxChar *buf, size_t size = 0 ); + // these functions allow to completely disable all log messages // is logging disabled now? static bool IsEnabled() { return ms_doLog; } @@ -475,16 +481,24 @@ WXDLLEXPORT const wxChar* wxSysErrorMsg(unsigned long nErrCode = 0); // ------------------- #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 @@ -520,7 +534,7 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode); #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 @@ -533,9 +547,13 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode); 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 @@ -567,3 +585,5 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode); #endif //debug/!debug #endif // _WX_LOG_H_ + +// vi:sts=4:sw=4:et