Add wxLogFormatterNone
This trivial class allows to easily disable all log formatting, including time stamping and level-dependent prefixes.
This commit is contained in:
parent
30dd7e9095
commit
2566a1abf5
2 changed files with 41 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue