![]() |
TSDuck
v3.35-3218
MPEG Transport Stream Toolkit
|
A report class which can be switched on and off at will. More...
Public Member Functions | |
SwitchableReport (Report &delegate, bool on=true) | |
Constructor. More... | |
bool | debug () const |
Check if debugging is active. More... | |
void | debug (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report a debug message with a printf-like interface. More... | |
void | debug (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report a debug message with a printf-like interface. More... | |
void | debug (const UString &msg) |
Report a debug message. More... | |
void | error (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report an error message with a printf-like interface. More... | |
void | error (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report an error message with a printf-like interface. More... | |
void | error (const UString &msg) |
Report an error message. More... | |
void | fatal (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report a fatal error message with a printf-like interface. More... | |
void | fatal (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report a fatal error message with a printf-like interface. More... | |
void | fatal (const UString &msg) |
Report a fatal error message. More... | |
bool | gotErrors () const |
Check if errors (or worse) were reported through this object. More... | |
void | info (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report an informational message with a printf-like interface. More... | |
void | info (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report an informational message with a printf-like interface. More... | |
void | info (const UString &msg) |
Report an informational message. More... | |
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. More... | |
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. More... | |
virtual void | log (int severity, const UString &msg) |
Report a message with an explicit severity. More... | |
int | maxSeverity () const |
Get maximum severity level. More... | |
virtual void | raiseMaxSeverity (int level) |
Raise maximum severity level. More... | |
void | resetErrors () |
Reset the error indicator. More... | |
virtual void | setMaxSeverity (int level) |
Set maximum severity level. More... | |
void | setSwitch (bool on) |
Set the switch state of this object. More... | |
void | severe (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report a severe error message with a printf-like interface. More... | |
void | severe (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report a severe error message with a printf-like interface. More... | |
void | severe (const UString &msg) |
Report a severe error message. More... | |
bool | verbose () const |
Check if verbose reporting is active. More... | |
void | verbose (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report a verbose message with a printf-like interface. More... | |
void | verbose (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report a verbose message with a printf-like interface. More... | |
void | verbose (const UString &msg) |
Report a verbose message. More... | |
void | warning (const UChar *fmt, std::initializer_list< ArgMixIn > args) |
Report a warning message with a printf-like interface. More... | |
void | warning (const UString &fmt, std::initializer_list< ArgMixIn > args) |
Report a warning message with a printf-like interface. More... | |
void | warning (const UString &msg) |
Report a warning message. More... | |
Protected Member Functions | |
virtual void | writeLog (int severity, const UString &msg) override |
Actual message reporting method. More... | |
Protected Attributes | |
volatile int | _max_severity |
Debug level is accessible to subclasses. | |
A report class which can be switched on and off at will.
This class implements the Report interface and delegates all reporting activities to some other instance of Report. In the meantime, from any thread, it is possible to switch the reporting on and off. When on, all messages are delegated to the other Report. When off, all messages are dropped.
|
explicit |
Constructor.
[in,out] | delegate | The report to which all messages are delegated when on. |
[in] | on | Initial state of the switch. |
void ts::SwitchableReport::setSwitch | ( | bool | on | ) |
Set the switch state of this object.
[in] | on | New state of the switch. When on is true, all messages are passed to the delegate. When on is off, all messages are dropped. |
|
overrideprotectedvirtual |
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. |
Implements ts::Report.
|
virtualinherited |
Set maximum severity level.
Messages with higher severities are not reported.
[in] | level | Set report to that level. |
Reimplemented in ts::ReportWithPrefix.
|
virtualinherited |
Raise maximum severity level.
[in] | level | Set report at least to that level. |
Reimplemented in ts::Args.
|
inlineinherited |
Get maximum severity level.
|
inlineinherited |
Check if debugging is active.
|
inlineinherited |
Report a debug message.
[in] | msg | Message text. |
|
inlineinherited |
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. |
|
inlineinherited |
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. |
|
inlineinherited |
Check if verbose reporting is active.
|
inlineinherited |
Report a verbose message.
[in] | msg | Message text. |
|
inlineinherited |
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. |
|
inlineinherited |
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. |
|
virtualinherited |
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. |
|
virtualinherited |
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. |
|
virtualinherited |
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. |
|
inlineinherited |
Report a fatal error message.
[in] | msg | Message text. |
|
inlineinherited |
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. |
|
inlineinherited |
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. |
|
inlineinherited |
Report a severe error message.
[in] | msg | Message text. |
|
inlineinherited |
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. |
|
inlineinherited |
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. |
|
inlineinherited |
Report an error message.
[in] | msg | Message text. |
|
inlineinherited |
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. |
|
inlineinherited |
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. |
|
inlineinherited |
Report a warning message.
[in] | msg | Message text. |
|
inlineinherited |
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. |
|
inlineinherited |
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. |
|
inlineinherited |
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. |
|
inlineinherited |
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. |
|
inlineinherited |
Check if errors (or worse) were reported through this object.
|
inlineinherited |
Reset the error indicator.