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


Public Member Functions | |
| AsyncReport (int max_severity=Severity::Info, const AsyncReportArgs &args=AsyncReportArgs()) | |
| virtual | ~AsyncReport () override |
| 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 | getSynchronous () const |
| bool | getTimeStamp () const |
| 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) |
| void | setSynchronous (bool on) |
| void | setTimeStamp (bool on) |
| 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) |
| void | terminate () |
| 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 | asyncThreadCompleted () |
| virtual void | asyncThreadLog (int severity, const UString &message) |
| virtual void | asyncThreadStarted () |
Asynchronous message report.
This class logs messages asynchronously. Each time a message is logged, the message is queued into an internal buffer and control returns immediately to the caller without waiting. The messages are logged later in one single low-priority thread.
In case of a huge amount of errors, there is no avalanche effect. If a caller cannot immediately enqueue a message or if the internal queue of messages is full, the message is dropped. In other words, reporting messages is guaranteed to never block, slow down or crash the application. Messages are dropped when necessary to avoid that kind of problem.
Messages are displayed on the standard error device by default.
| ts::AsyncReport::AsyncReport | ( | int | max_severity = Severity::Info, |
| const AsyncReportArgs & | args = AsyncReportArgs() ) |
Constructor. The default initial report level is Info.
| [in] | max_severity | Set initial level report to that level. |
| [in] | args | Initial parameters. |
|
overridevirtual |
Destructor.
|
inline |
Activate or deactivate time stamps in log messages
| [in] | on | If true, time stamps are added to all messages. |
|
inline |
Check if time stamps are added in log messages.
|
inline |
Activate or deactivate the synchronous mode
| [in] | on | If true, the delivery of messages is synchronous. No message is dropped, all messages are delivered. |
|
inline |
Check if synchronous mode is on.
| void ts::AsyncReport::terminate | ( | ) |
Synchronously terminate the report thread. Automatically performed in destructor.
|
protectedvirtual |
This method is called in the context of the asynchronous logging thread when it starts. The default implementation does nothing. Subclasses may override it to get notified.
|
protectedvirtual |
This method is called in the context of the asynchronous logging thread to log a message. The default implementation prints the message on the standard error.
| [in] | severity | Severity level of the message. |
| [in] | message | The message line to log. |
|
protectedvirtual |
This method is called in the context of the asynchronous logging thread when it completes. The default implementation does nothing. Subclasses may override it to get notified.
|
inherited |
Set maximum severity level. Messages with higher severities are not reported.
| [in] | level | Set report to that level. |
|
inherited |
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. |
|
inlineinherited |
Get maximum severity level.
|
inlineinherited |
Check if errors (or worse) were reported through this object. Errors which were reported through delegated reports are ignored.
|
inlineinherited |
Reset the error indicator.
|
inlineinherited |
Set the prefix to display before each message.
| [in] | prefix | The prefix to prepend to all messages. |
|
inlineinherited |
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. |
|
inlineinherited |
Check if debugging is active.
|
inlineinherited |
Report a debug message.
| [in] | msg | Message line. |
|
inlineinherited |
Report a debug message.
| [in] | msg | Message line. |
|
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 line. |
|
inlineinherited |
Report a verbose message.
| [in] | msg | Message line. |
|
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. |
|
inherited |
Report a message with an explicit severity.
| [in] | severity | Message severity. |
| [in] | msg | Message line. |
|
inlineinherited |
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 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 line. |
|
inlineinherited |
Report a fatal error message.
| [in] | msg | Message line. |
|
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 line. |
|
inlineinherited |
Report a severe error message.
| [in] | msg | Message line. |
|
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 line. |
|
inlineinherited |
Report an error message.
| [in] | msg | Message line. |
|
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 error message.
| [in] | msg | Message line. |
|
inlineinherited |
Report a warning error message.
| [in] | msg | Message line. |
|
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 line. |
|
inlineinherited |
Report an informational message.
| [in] | msg | Message line. |
|
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 |
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. |