Imt.Base C++ API V4.1.1.0
Loading...
Searching...
No Matches
imt::base::dff::runtime::RuntimeLog Class Referencefinal

Implementation of a simple centralized logging mechanism. More...

#include <Imt.Base.Dff.Runtime/inc/Imt.Base.Dff.Runtime/RuntimeLog.h>

Inheritance diagram for imt::base::dff::runtime::RuntimeLog:
imt::base::core::platform::StaticClass

Static Public Member Functions

static void init (RuntimeCore::CoreHandle const loggerHandle)
 Initialize the logger.
 
static void setLogLevelThreshold (uint8_t const logLevelThreshold)
 Set the threshold of the highest logging level which is not filtered.
 
static void sendLog (uint8_t const logLevel, ::imt::base::core::serialization::SerializableIfc const &logMessage, size_t const logMessageSize)
 Send a log message if logLevel is <= LogLevelThreshold.
 

Static Public Attributes

static constexpr uint8_t DEFAULT_LOG_LEVEL_THRESHOLD {std::numeric_limits<uint8_t>::max()}
 The log level threshold is set tho this value for default.
 

Detailed Description

Implementation of a simple centralized logging mechanism.

An Executable can be registered to receive the logging messages by passing its CoreHandle to the init function. The content of a logging message can be defined in application (derive from SerializableIfc). If no handler is registered, the message will be discarded. By default all log messages are send (log level threshold filter inactive).

Definition at line 56 of file RuntimeLog.h.

Member Function Documentation

◆ init()

static void imt::base::dff::runtime::RuntimeLog::init ( RuntimeCore::CoreHandle const  loggerHandle)
static

Initialize the logger.

Parameters
loggerHandleHandle of the logger which receives the logging messages.

◆ sendLog()

static void imt::base::dff::runtime::RuntimeLog::sendLog ( uint8_t const  logLevel,
::imt::base::core::serialization::SerializableIfc const &  logMessage,
size_t const  logMessageSize 
)
static

Send a log message if logLevel is <= LogLevelThreshold.

If logger is not initialized the message will be discarded.

Parameters
logLevelLogging level of the given log message.
logMessageLog message.
logMessageSizesize of log message in bytes

◆ setLogLevelThreshold()

static void imt::base::dff::runtime::RuntimeLog::setLogLevelThreshold ( uint8_t const  logLevelThreshold)
static

Set the threshold of the highest logging level which is not filtered.

A higher log level has a lower value (0 = highest log level, 255 = lowest log level).

Note
default threshold is set to DEFAULT_LOG_LEVEL_THRESHOLD.
Parameters
logLevelThresholdLogging level threshold.

Member Data Documentation

◆ DEFAULT_LOG_LEVEL_THRESHOLD

constexpr uint8_t imt::base::dff::runtime::RuntimeLog::DEFAULT_LOG_LEVEL_THRESHOLD {std::numeric_limits<uint8_t>::max()}
staticconstexpr

The log level threshold is set tho this value for default.

Definition at line 63 of file RuntimeLog.h.


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