X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c11d62a6e22ead4c327b7ad45ad466b451b1aff6..5fd588d2298a44428ac66bef1e4d9fc73e18d4fd:/include/wx/log.h diff --git a/include/wx/log.h b/include/wx/log.h index 00485e46de..f4b5163c2b 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -12,7 +12,7 @@ #ifndef _WX_LOG_H_ #define _WX_LOG_H_ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "log.h" #endif @@ -40,7 +40,9 @@ typedef unsigned long wxLogLevel; #if wxUSE_LOG +#ifndef __WXWINCE__ #include // for time_t +#endif #include "wx/dynarray.h" @@ -177,6 +179,8 @@ public: static void RemoveTraceMask(const wxString& str); // remove all string trace masks static void ClearTraceMasks(); + // get string trace masks + static const wxArrayString &GetTraceMasks() { return ms_aTraceMasks; } // sets the timestamp string: this is used as strftime() format string // for the log targets which add time stamps to the messages - set it @@ -241,7 +245,7 @@ private: class WXDLLEXPORT wxLogStderr : public wxLog { DECLARE_NO_COPY_CLASS(wxLogStderr) - + public: // redirect log output to a FILE wxLogStderr(FILE *fp = (FILE *) NULL); @@ -487,11 +491,13 @@ 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, ...) +extern void WXDLLEXPORT wxLog##level(const wxChar *szFormat, \ + ...) ATTRIBUTE_PRINTF_1 #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, ...) +extern void WXDLLEXPORT wxLog##level(arg1, const wxChar *szFormat, \ + ...) ATTRIBUTE_PRINTF_2 #else // !wxUSE_LOG @@ -563,7 +569,7 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode); // wxLogFatalError helper: show the (fatal) error to the user in a safe way, // i.e. without using wxMessageBox() for example because it could crash -extern void wxSafeShowMessage(const wxString& title, const wxString& text); +void WXDLLEXPORT wxSafeShowMessage(const wxString& title, const wxString& text); // ---------------------------------------------------------------------------- // debug only logging functions: use them with API name and error code @@ -575,14 +581,14 @@ extern void wxSafeShowMessage(const wxString& title, const wxString& text); #ifdef __VISUALC__ #define wxLogApiError(api, rc) \ wxLogDebug(wxT("%s(%d): '%s' failed with error 0x%08lx (%s)."), \ - __TFILE__, __LINE__, api, \ - rc, wxSysErrorMsg(rc)) + __TFILE__, __LINE__, api, \ + (long)rc, wxSysErrorMsg(rc)) #else // !VC++ #define wxLogApiError(api, rc) \ wxLogDebug(wxT("In file %s at line %d: '%s' failed with " \ - "error 0x%08lx (%s)."), \ - __TFILE__, __LINE__, api, \ - rc, wxSysErrorMsg(rc)) + "error 0x%08lx (%s)."), \ + __TFILE__, __LINE__, api, \ + (long)rc, wxSysErrorMsg(rc)) #endif // VC++/!VC++ #define wxLogLastError(api) wxLogApiError(api, wxSysErrorCode()) @@ -594,3 +600,4 @@ extern void wxSafeShowMessage(const wxString& title, const wxString& text); #endif // _WX_LOG_H_ +// vi:sts=4:sw=4:et