![]() |
TSDuck v3.36-3487
MPEG Transport Stream Toolkit
|
Abstract interface for event reporting and monitoring. More...
#include <tsReport.h>
Public Member Functions | |
Report (int max_severity=Severity::Info) | |
Constructor. | |
virtual | ~Report () |
Destructor. | |
bool | debug () const |
Check if debugging is active. | |
void | debug (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report a debug message with a printf-like interface. | |
void | debug (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report a debug message with a printf-like interface. | |
void | debug (const UString &msg) |
Report a debug message. | |
void | error (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report an error message with a printf-like interface. | |
void | error (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report an error message with a printf-like interface. | |
void | error (const UString &msg) |
Report an error message. | |
void | fatal (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report a fatal error message with a printf-like interface. | |
void | fatal (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report a fatal error message with a printf-like interface. | |
void | fatal (const UString &msg) |
Report a fatal error message. | |
bool | gotErrors () const |
Check if errors (or worse) were reported through this object. | |
void | info (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report an informational message with a printf-like interface. | |
void | info (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report an informational message with a printf-like interface. | |
void | info (const UString &msg) |
Report an informational message. | |
virtual void | log (int severity, const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report a message with an explicit severity and a printf-like interface. | |
virtual void | log (int severity, const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report a message with an explicit severity and a printf-like interface. | |
virtual void | log (int severity, const UString &msg) |
Report a message with an explicit severity. | |
int | maxSeverity () const |
Get maximum severity level. | |
virtual void | raiseMaxSeverity (int level) |
Raise maximum severity level. | |
void | resetErrors () |
Reset the error indicator. | |
virtual void | setMaxSeverity (int level) |
Set maximum severity level. | |
void | severe (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report a severe error message with a printf-like interface. | |
void | severe (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report a severe error message with a printf-like interface. | |
void | severe (const UString &msg) |
Report a severe error message. | |
bool | verbose () const |
Check if verbose reporting is active. | |
void | verbose (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report a verbose message with a printf-like interface. | |
void | verbose (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report a verbose message with a printf-like interface. | |
void | verbose (const UString &msg) |
Report a verbose message. | |
void | warning (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report a warning message with a printf-like interface. | |
void | warning (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report a warning message with a printf-like interface. | |
void | warning (const UString &msg) |
Report a warning message. | |
Protected Member Functions | |
virtual void | writeLog (int severity, const UString &msg)=0 |
Actual message reporting method. | |
Protected Attributes | |
volatile int | _max_severity = Severity::Info |
Debug level is accessible to subclasses. | |
Abstract interface for event reporting and monitoring.
|
inline |
Constructor.
The default initial report level is Info.
[in] | max_severity | Initial maximum severity of reported messages. |
|
virtual |
Set maximum severity level.
Messages with higher severities are not reported.
[in] | level | Set report to that level. |
Reimplemented in ts::ReportWithPrefix.
|
virtual |
Raise maximum severity level.
[in] | level | Set report at least to that level. |
Reimplemented in ts::Args.
|
inline |
Get maximum severity level.
|
inline |
Check if debugging is active.
|
inline |
Check if verbose reporting is active.
|
virtual |
Report a message with an explicit severity.
This method is the central reporting point. If filters the severity and drops the message if severity is higher than maxSeverity().
Subclasses should override writeLog() to implement a specific reporting device. It is not necessary to override log() unless the subclass needs to implement a different severity filtering policy.
[in] | severity | Message severity. |
[in] | msg | Message text. |
|
virtual |
Report a message with an explicit severity and a printf-like interface.
[in] | severity | Message severity. |
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
|
virtual |
Report a message with an explicit severity and a printf-like interface.
[in] | severity | Message severity. |
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
|
inline |
Report a fatal error message.
[in] | msg | Message text. |
Report a fatal error message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
Report a fatal error message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
|
inline |
Report a severe error message.
[in] | msg | Message text. |
Report a severe error message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
Report a severe error message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
|
inline |
Report an error message.
[in] | msg | Message text. |
Report an error message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
Report an error message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
|
inline |
Report a warning message.
[in] | msg | Message text. |
Report a warning message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
Report a warning message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
|
inline |
Report an informational message.
[in] | msg | Message text. |
Report an informational message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
Report an informational message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
|
inline |
Report a verbose message.
[in] | msg | Message text. |
Report a verbose message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
Report a verbose message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
|
inline |
Report a debug message.
[in] | msg | Message text. |
Report a debug message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
Report a debug message with a printf-like interface.
[in] | fmt | Format string with embedded '%' sequences. |
[in] | args | List of arguments to substitute in the format string. |
|
inline |
Check if errors (or worse) were reported through this object.
|
inline |
Reset the error indicator.
|
protectedpure virtual |
Actual message reporting method.
Must be implemented in actual classes. The method is called only when a message passed the severity filter. It is not necessary to recheck severity inside the method.
[in] | severity | Message severity. |
[in] | msg | Message text. |
Implemented in ts::Args, ts::ReportBuffer< MUTEX >, ts::ReportFile< MUTEX >, ts::Plugin, ts::TelnetConnection, ts::CerrReport, ts::NullReport, ts::ReportWithPrefix, ts::SwitchableReport, and ts::PluginThread.