35#include <wx/textctrl.h>
36#include <wx/statusbr.h>
58 wxFAIL_MSG(
"HasMessageOfSeverity is not implemented in this reporter" );
66 wxT(
"No wxTextCtrl object defined in WX_TEXT_CTRL_REPORTER." ) );
120 static REPORTER* s_nullReporter =
nullptr;
122 if( !s_nullReporter )
125 return *s_nullReporter;
131 FILE* target = stdout;
136 if( aMsg.EndsWith( wxS(
"\n" ) ) )
137 wxFprintf( target, aMsg );
139 wxFprintf( target, aMsg + wxS(
"\n" ) );
149 return s_cliReporter;
167 std::cout << aMsg << std::endl;
175 static REPORTER* s_stdoutReporter =
nullptr;
177 if( !s_stdoutReporter )
180 return *s_stdoutReporter;
204 static REPORTER* s_wxLogReporter =
nullptr;
207 if( !s_wxLogReporter )
210 return *s_wxLogReporter;
Reporter forwarding messages to stdout or stderr as appropriate.
REPORTER & Report(const wxString &aMsg, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
static REPORTER & GetInstance()
static REPORTER & GetInstance()
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
A pure virtual class used to derive REPORTER objects from.
virtual bool HasMessageOfSeverity(int aSeverityMask) const
Returns true if the reporter has one or more messages matching the specified severity mask.
virtual bool HasMessage() const =0
Returns true if the reporter client is non-empty.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
wxStatusBar * m_statusBar
bool HasMessage() const override
Returns true if the reporter client is non-empty.
REPORTER & Report(const wxString &aMsg, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
static REPORTER & GetInstance()
REPORTER & Report(const wxString &aMsg, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
static REPORTER & GetInstance()
bool HasMessage() const override
Returns true if the reporter client is non-empty.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
bool HasMessageOfSeverity(int aSeverityMask) const override
Returns true if the reporter has one or more messages matching the specified severity mask.
const wxString & GetMessages() const
bool HasMessage() const override
Returns true if the reporter client is non-empty.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
static const wxChar traceReporter[]
Flag to enable reporter debugging output.
This file contains miscellaneous commonly used macros and functions.
static std::mutex g_logReporterMutex
wxString From_UTF8(const char *cstring)