X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/766aecab3a30f6038477943790bf34e0ab91e286..8af28fabffca3144a38602fa801205cd1183533c:/include/wx/log.h diff --git a/include/wx/log.h b/include/wx/log.h index 01d37ca61d..5a2c119abc 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -243,6 +243,14 @@ public: // change it otherwise) static void TimeStamp(wxString *str); + // this method should only be called from derived classes DoLog() + // implementations and shouldn't be called directly, use logging functions + // instead + void Log(wxLogLevel level, const wxString& msg, time_t t) + { + DoLog(level, msg, t); + } + // make dtor virtual for all derived classes virtual ~wxLog(); @@ -256,7 +264,7 @@ public: #endif protected: - // the logging functions that can be overriden + // the logging functions that can be overridden // default DoLog() prepends the time stamp and a prefix corresponding // to the message to szString and then passes it to DoLogString() @@ -369,7 +377,7 @@ protected: private: wxString m_str; - DECLARE_NO_COPY_CLASS(wxLogBuffer) + wxDECLARE_NO_COPY_CLASS(wxLogBuffer); }; @@ -378,7 +386,7 @@ class WXDLLIMPEXP_BASE wxLogStderr : public wxLog { public: // redirect log output to a FILE - wxLogStderr(FILE *fp = (FILE *) NULL); + wxLogStderr(FILE *fp = NULL); protected: // implement sink function @@ -388,7 +396,7 @@ protected: FILE *m_fp; - DECLARE_NO_COPY_CLASS(wxLogStderr) + wxDECLARE_NO_COPY_CLASS(wxLogStderr); }; #if wxUSE_STD_IOSTREAM @@ -492,7 +500,7 @@ private: // do we pass the messages to the old logger? bool m_bPassMessages; - DECLARE_NO_COPY_CLASS(wxLogChain) + wxDECLARE_NO_COPY_CLASS(wxLogChain); }; // a chain log target which uses itself as the new logger @@ -505,7 +513,7 @@ public: wxLogInterposer(); private: - DECLARE_NO_COPY_CLASS(wxLogInterposer) + wxDECLARE_NO_COPY_CLASS(wxLogInterposer); }; // a temporary interposer which doesn't destroy the old log target @@ -517,7 +525,7 @@ public: wxLogInterposerTemp(); private: - DECLARE_NO_COPY_CLASS(wxLogInterposerTemp) + wxDECLARE_NO_COPY_CLASS(wxLogInterposerTemp); }; #if wxUSE_GUI @@ -751,7 +759,14 @@ DECLARE_LOG_FUNCTION2(SysError, unsigned long, lErrCode); // empty functions if their parameters are complicated enough, but by // defining them as an empty inline function we ensure that even dumbest // compilers optimise them away +#ifdef __BORLANDC__ + // but Borland gives "W8019: Code has no effect" for wxLogNop() so we need + // to define it differently for it to avoid these warnings (same problem as + // with wxUnusedVar()) + #define wxLogNop() { } +#else inline void wxLogNop() { } +#endif #define wxVLogDebug(fmt, valist) wxLogNop() #define wxVLogTrace(mask, fmt, valist) wxLogNop()