![]() |
TSDuck
v3.35-3218
MPEG Transport Stream Toolkit
|
A subclass of ts::Report which logs all messages in an internal buffer. More...
Public Member Functions | |
ReportBuffer (int max_severity=Severity::Info) | |
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... | |
bool | emptyMessages () const |
Check if the content of the internal buffer is empty. 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... | |
UString | getMessages () const |
Get the content of the internal buffer. 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... | |
void | resetMessages () |
Reset the content of the internal buffer. | |
virtual void | setMaxSeverity (int level) |
Set maximum severity level. 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 &message) override |
Actual message reporting method. More... | |
Protected Attributes | |
volatile int | _max_severity |
Debug level is accessible to subclasses. | |
A subclass of ts::Report which logs all messages in an internal buffer.
Reentrancy is supported though the template parameter MUTEX.
MUTEX | A subclass of ts::MutexInterface which is used to serialize access to the buffer. By default, the class ts::NullMutex is used, meaning that there is no synchronization on the file. Multi-threaded applications must use an appropriate mutex class, typically ts::Mutex. |
ts::ReportBuffer< MUTEX >::ReportBuffer | ( | int | max_severity = Severity::Info | ) |
Constructor.
[in] | max_severity | Maximum debug level to display. None by default. |
UString ts::ReportBuffer< MUTEX >::getMessages | ( | ) | const |
Get the content of the internal buffer.
bool ts::ReportBuffer< MUTEX >::emptyMessages | ( | ) | const |
Check if the content of the internal buffer is empty.
|
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.