TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
A logger class for TLV messages. More...
#include <tstlvLogger.h>
Public Member Functions | |
Logger (int default_level=Severity::Info, Report *default_report=nullptr) | |
Default constructor. | |
int | defaultSeverity () const |
Get the default severity level. | |
void | log (const Message &msg, const UString &comment=UString(), Report *report=nullptr) |
Report a TLV message. | |
Report & | report () |
Get a reference to the default report object. | |
void | resetSeverities (int default_level=Severity::Info) |
Reset all severities. | |
void | setDefaultSeverity (int level) |
Set the default severity level. | |
void | setReport (Report *default_report) |
Set a new default report object. | |
void | setSeverity (TAG tag, int level) |
Set the severity level for one specific message tag. | |
int | severity (TAG tag) const |
Get the severity level for one specific level. | |
A logger class for TLV messages.
This class encapsulates a logging and debug facility for TLV messages. All messages are logged on a Report object under specific conditions. Each message, based on its tag, is logged with a specific severity. Depending on its maximum severity, the report will display or not each message.
ts::tlv::Logger::Logger | ( | int | default_level = Severity::Info , |
Report * | default_report = nullptr |
||
) |
Default constructor.
[in] | default_level | Default logging level of messages. |
[in] | default_report | Where to report messages. Can be null. |
|
inline |
Set the default severity level.
This level applies to messages without a specific log level.
[in] | level | Default logging level of messages. |
|
inline |
Get the default severity level.
This level applies to messages without a specific log level.
|
inline |
Set the severity level for one specific message tag.
[in] | tag | Message tag. |
[in] | level | Logging level for messages using tag. |
int ts::tlv::Logger::severity | ( | TAG | tag | ) | const |
Get the severity level for one specific level.
[in] | tag | Message tag. |
void ts::tlv::Logger::resetSeverities | ( | int | default_level = Severity::Info | ) |
Reset all severities.
[in] | default_level | Default logging level of messages. |
void ts::tlv::Logger::setReport | ( | Report * | default_report | ) |
Set a new default report object.
[in] | default_report | Where to report messages. Can be null. |
|
inline |
Get a reference to the default report object.
void ts::tlv::Logger::log | ( | const Message & | msg, |
const UString & | comment = UString() , |
||
Report * | report = nullptr |
||
) |
Report a TLV message.
[in] | msg | The message to log. |
[in] | comment | Optional leading comment line (before the message). |
[in] | report | Where to report the message. If null, use the default report. |