![]() |
TSDuck v3.46-4930
MPEG Transport Stream Toolkit
|
#include <tsReport.h>

Public Member Functions | |
| Report ()=default | |
| Report (int max_severity, const UString &prefix=UString(), Report *report=nullptr) | |
| virtual | ~Report () |
| bool | debug () const |
| template<class... Args> | |
| void | debug (const UChar *fmt, Args &&... args) |
| void | debug (const UChar *msg) |
| template<class... Args> | |
| void | debug (const UString &fmt, Args &&... args) |
| void | debug (const UString &msg) |
| Report * | delegateReport (Report *report) |
| template<class... Args> | |
| void | error (const UChar *fmt, Args &&... args) |
| void | error (const UChar *msg) |
| template<class... Args> | |
| void | error (const UString &fmt, Args &&... args) |
| void | error (const UString &msg) |
| template<class... Args> | |
| void | fatal (const UChar *fmt, Args &&... args) |
| void | fatal (const UChar *msg) |
| template<class... Args> | |
| void | fatal (const UString &fmt, Args &&... args) |
| void | fatal (const UString &msg) |
| bool | gotErrors () const |
| template<class... Args> | |
| void | info (const UChar *fmt, Args &&... args) |
| void | info (const UChar *msg) |
| template<class... Args> | |
| void | info (const UString &fmt, Args &&... args) |
| void | info (const UString &msg) |
| template<class... Args> | |
| void | log (int severity, const UChar *fmt, Args &&... args) |
| template<class... Args> | |
| void | log (int severity, const UString &fmt, Args &&... args) |
| void | log (int severity, const UString &msg) |
| int | maxSeverity () const |
| void | raiseMaxSeverity (int level) |
| UString | reportPrefix () const |
| void | resetErrors () |
| void | setMaxSeverity (int level) |
| void | setReportPrefix (const UString &prefix) |
| template<class... Args> | |
| void | severe (const UChar *fmt, Args &&... args) |
| void | severe (const UChar *msg) |
| template<class... Args> | |
| void | severe (const UString &fmt, Args &&... args) |
| void | severe (const UString &msg) |
| bool | verbose () const |
| template<class... Args> | |
| void | verbose (const UChar *fmt, Args &&... args) |
| void | verbose (const UChar *msg) |
| template<class... Args> | |
| void | verbose (const UString &fmt, Args &&... args) |
| void | verbose (const UString &msg) |
| template<class... Args> | |
| void | warning (const UChar *fmt, Args &&... args) |
| void | warning (const UChar *msg) |
| template<class... Args> | |
| void | warning (const UString &fmt, Args &&... args) |
| void | warning (const UString &msg) |
Protected Member Functions | |
| virtual void | writeLog (int severity, const UString &msg) |
Base class for message reporting and monitoring.
Maximum severity: Each Report instance has an adjustable "maximum severity". All messages with a higher severity are dropped without reporting. The initial default severity is Info, meaning that Verbose and Debug messages are dropped by default.
Report delegation: A Report can delegate its message reporting to another Report. Each Report has at most one delegate and several delagators (other Reports which delegate to this object). Therefore, there is a tree of Reports which ultimately ends to one Report which does the actual message logging. All Reports in that tree share the same maximum severity. When the maximum severity is changed in one Report, it is updated in all Reports in the tree.
Delegation and thread synchronization: We tried to find the right balance between performances and synchronization.
|
default |
Default constructor. The default initial report level is Info.
| ts::Report::Report | ( | int | max_severity, |
| const UString & | prefix = UString(), | ||
| Report * | report = nullptr ) |
Constructor with initial report level, prefix and delegation.
| [in] | max_severity | Initial maximum severity of reported messages. |
| [in] | prefix | The prefix to prepend to all messages. |
| [in] | report | New report object to which messages are delegated. |
|
virtual |
Destructor.
It is unsafe to delete a Report when it has delegators (i.e. when other Reports delegate to this object). Race conditions exist when a delegator logs a message at the same time its delegate is destructed.
| void ts::Report::setMaxSeverity | ( | int | level | ) |
Set maximum severity level. Messages with higher severities are not reported.
| [in] | level | Set report to that level. |
| void ts::Report::raiseMaxSeverity | ( | int | level | ) |
Raise maximum severity level. The severity can only be increased (more verbose, more debug), never decreased.
| [in] | level | Set report at least to that level. |
|
inline |
Get maximum severity level.
|
inline |
Check if errors (or worse) were reported through this object. Errors which were reported through delegated reports are ignored.
|
inline |
Reset the error indicator.
|
inline |
Set the prefix to display before each message.
| [in] | prefix | The prefix to prepend to all messages. |
|
inline |
Get the current prefix to display.
Delegate message logging to another report object.
| [in] | report | New report object to which messages are delegated. Use nullptr to remove the delegation and return to normal logging. |
|
inline |
Check if debugging is active.
|
inline |
Check if verbose reporting is active.
| void ts::Report::log | ( | int | severity, |
| const UString & | msg ) |
Report a message with an explicit severity.
| [in] | severity | Message severity. |
| [in] | msg | Message line. |
|
inline |
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 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 line. |
|
inline |
Report a fatal error message.
| [in] | msg | Message line. |
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 line. |
|
inline |
Report a severe error message.
| [in] | msg | Message line. |
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 line. |
|
inline |
Report an error message.
| [in] | msg | Message line. |
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 error message.
| [in] | msg | Message line. |
|
inline |
Report a warning error message.
| [in] | msg | Message line. |
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 line. |
|
inline |
Report an informational message.
| [in] | msg | Message line. |
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 line. |
|
inline |
Report a verbose message.
| [in] | msg | Message line. |
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 line. |
|
inline |
Report a debug message.
| [in] | msg | Message line. |
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. |
|
protectedvirtual |
Actual message reporting method. The method is called only when a message passed the severity filter. It is not necessary to recheck the maximum severity inside the method. By default, does nothing.
| [in] | severity | Message severity. |
| [in] | msg | Message text. |
Reimplemented in ts::Args, ts::CerrReport, ts::NullReport, ts::ReportBuffer< SAFETY >, ts::ReportFile< SAFETY >, and ts::TextStream.