X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/339360262a91d1033d5b91887333bfac193896fd..3df732cd473eb29e12ce374afe074c404a86f55e:/include/wx/log.h diff --git a/include/wx/log.h b/include/wx/log.h index eef804d039..b1309ce30a 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -288,11 +288,36 @@ private: // "trivial" derivations of wxLog // ---------------------------------------------------------------------------- +#if wxABI_VERSION > 20601 + +// log everything to a buffer +class WXDLLIMPEXP_BASE wxLogBuffer : public wxLog +{ +public: + wxLogBuffer() { } + + // get the string contents with all messages logged + const wxString& GetBuffer() const { return m_str; } + + // show the buffer contents to the user in the best possible way (this uses + // wxMessageOutputMessageBox) and clear it + virtual void Flush(); + +protected: + virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t); + virtual void DoLogString(const wxChar *szString, time_t t); + +private: + wxString m_str; + + DECLARE_NO_COPY_CLASS(wxLogBuffer) +}; + +#endif // wxABI_VERSION + // log everything to a "FILE *", stderr by default class WXDLLIMPEXP_BASE wxLogStderr : public wxLog { - DECLARE_NO_COPY_CLASS(wxLogStderr) - public: // redirect log output to a FILE wxLogStderr(FILE *fp = (FILE *) NULL); @@ -302,6 +327,8 @@ protected: virtual void DoLogString(const wxChar *szString, time_t t); FILE *m_fp; + + DECLARE_NO_COPY_CLASS(wxLogStderr) }; #if wxUSE_STD_IOSTREAM