TSDuck v3.40-3963
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::tlv::Logger Class Reference

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.
 
Reportreport ()
 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Logger()

ts::tlv::Logger::Logger ( int  default_level = Severity::Info,
Report default_report = nullptr 
)

Default constructor.

Parameters
[in]default_levelDefault logging level of messages.
[in]default_reportWhere to report messages. Can be null.

Member Function Documentation

◆ setDefaultSeverity()

void ts::tlv::Logger::setDefaultSeverity ( int  level)
inline

Set the default severity level.

This level applies to messages without a specific log level.

Parameters
[in]levelDefault logging level of messages.

◆ defaultSeverity()

int ts::tlv::Logger::defaultSeverity ( ) const
inline

Get the default severity level.

This level applies to messages without a specific log level.

Returns
The default severity level.

◆ setSeverity()

void ts::tlv::Logger::setSeverity ( TAG  tag,
int  level 
)
inline

Set the severity level for one specific message tag.

Parameters
[in]tagMessage tag.
[in]levelLogging level for messages using tag.

◆ severity()

int ts::tlv::Logger::severity ( TAG  tag) const

Get the severity level for one specific level.

Parameters
[in]tagMessage tag.
Returns
The severity level.

◆ resetSeverities()

void ts::tlv::Logger::resetSeverities ( int  default_level = Severity::Info)

Reset all severities.

Parameters
[in]default_levelDefault logging level of messages.

◆ setReport()

void ts::tlv::Logger::setReport ( Report default_report)

Set a new default report object.

Parameters
[in]default_reportWhere to report messages. Can be null.

◆ report()

Report & ts::tlv::Logger::report ( )
inline

Get a reference to the default report object.

Returns
A reference to the default report object.

◆ log()

void ts::tlv::Logger::log ( const Message msg,
const UString comment = UString(),
Report report = nullptr 
)

Report a TLV message.

Parameters
[in]msgThe message to log.
[in]commentOptional leading comment line (before the message).
[in]reportWhere to report the message. If null, use the default report.

The documentation for this class was generated from the following file: