Add wxLogFormatterNone

This trivial class allows to easily disable all log formatting,
including time stamping and level-dependent prefixes.
This commit is contained in:
Vadim Zeitlin 2024-01-07 22:31:52 +01:00
parent 30dd7e9095
commit 2566a1abf5
2 changed files with 41 additions and 0 deletions

View file

@ -341,6 +341,19 @@ protected:
#endif // WXWIN_COMPATIBILITY_3_0
};
// Special kind of trivial formatter which simply uses the message unchanged.
class wxLogFormatterNone : public wxLogFormatter
{
public:
wxLogFormatterNone() = default;
virtual wxString Format(wxLogLevel WXUNUSED(level),
const wxString& msg,
const wxLogRecordInfo& WXUNUSED(info)) const override
{
return msg;
}
};
// ----------------------------------------------------------------------------
// derive from this class to redirect (or suppress, or ...) log messages