wxMaxima
|
Redirect error messages (but not warnings) to a second target. More...
#include <ErrorRedirector.h>
Public Member Functions | |
ErrorRedirector (std::unique_ptr< wxLog > &&newLog) | |
Sets the specified logger (which may be NULL) as the default log target but the log messages are also passed to the previous log target if any. | |
virtual | ~ErrorRedirector () override |
Restores the previous log target. | |
void | Flush () override |
This method is called from the idle loop. | |
void | DoLogRecord (wxLogLevel level, const wxString &msg, const wxLogRecordInfo &info) override |
void | DetachOldLog () |
Detaches the old log target so it won't be destroyed when the wxLogChain object is destroyed. | |
void | SetBatchMode () |
Sets the "batch mode" flag that causes error messages to be output to stderr, as well. | |
wxLog * | GetOldLog () const |
Returns the pointer to the previously active log target (which may be NULL). | |
void | SetLog (std::unique_ptr< wxLog > &&logger) |
Sets and takes ownership of another log target to use (may be nullptr). | |
void | SetLogThis () |
Sets ourseves as the log target. | |
Static Public Member Functions | |
static void | LogToStdErr () |
Output all log messages to stderr, too. | |
static bool | LoggingToStdErr () |
Output all log messages to stderr, too. | |
Static Public Attributes | |
static int | m_messages_logPaneOnly = 0 |
A variable used by the SuppressErrorDialogs class. | |
Redirect error messages (but not warnings) to a second target.
|
override |
This method is called from the idle loop.
All log targets collect log messages between calls to Flush.
void ErrorRedirector::SetLog | ( | std::unique_ptr< wxLog > && | logger | ) |
Sets and takes ownership of another log target to use (may be nullptr).
The previously owned logger - if any - is destroyed. This doesn't change the old log target value (the one the messages are forwarded to) which still remains the same as was active when wxLogChain object was created.
|
static |
A variable used by the SuppressErrorDialogs class.
>=0 means: Messages should appear in the log pane only.