29#ifndef ERRORREDIRECTOR_H
30#define ERRORREDIRECTOR_H
58 void Flush()
override;
60 void DoLogRecord(wxLogLevel level,
62 const wxLogRecordInfo& info)
override;
85 void SetLog(std::unique_ptr<wxLog> &&logger);
103 bool m_batchMode =
false;
107 static bool m_logToStdErr;
Redirect error messages (but not warnings) to a second target.
Definition: ErrorRedirector.h:38
void SetLog(std::unique_ptr< wxLog > &&logger)
Sets and takes ownership of another log target to use (may be nullptr).
Definition: ErrorRedirector.cpp:57
void Flush() override
This method is called from the idle loop.
Definition: ErrorRedirector.cpp:97
virtual ~ErrorRedirector() override
Restores the previous log target.
Definition: ErrorRedirector.cpp:51
static int m_messages_logPaneOnly
A variable used by the SuppressErrorDialogs class.
Definition: ErrorRedirector.h:44
void SetLogThis()
Sets ourseves as the log target.
Definition: ErrorRedirector.cpp:64
wxLog * GetOldLog() const
Returns the pointer to the previously active log target (which may be NULL).
void DetachOldLog()
Detaches the old log target so it won't be destroyed when the wxLogChain object is destroyed.
static bool LoggingToStdErr()
Output all log messages to stderr, too.
Definition: ErrorRedirector.h:93
static void LogToStdErr()
Output all log messages to stderr, too.
Definition: ErrorRedirector.h:90
void SetBatchMode()
Sets the "batch mode" flag that causes error messages to be output to stderr, as well.
Definition: ErrorRedirector.h:71
wxLog * m_logNew
the current log target - equal to m_logOwned or this
Definition: ErrorRedirector.h:97
wxLog *const m_logOld
the previous log target
Definition: ErrorRedirector.h:99
std::unique_ptr< wxLog > m_logOwned
the owned new log, of null if no log is owned
Definition: ErrorRedirector.h:101
If a variable of this class is alive errors won't create popup dialogues.
Definition: ErrorRedirector.h:112