Dataflow Runtime API  3.1.1.0
Static Public Member Functions | Static Public Attributes | List of all members
imt::base::dff::runtime::RuntimeLog Class Reference

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

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

Static Public Member Functions

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

Static Public Attributes

static const uint8_t DEFAULT_LOG_LEVEL_THRESHOLD = UINT8_MAX
 The log level threshold is set tho this value for default. More...
 

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

Member Function Documentation

◆ init()

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

Initialize the logger.

Parameters
loggerHandleHandle of the logger which receives the logging messages.

◆ sendLog()

static void imt::base::dff::runtime::RuntimeLog::sendLog ( const uint8_t  logLevel,
const imt::base::core::serialization::SerializableIfc logMessage,
const size_t  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 ( const uint8_t  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

const uint8_t imt::base::dff::runtime::RuntimeLog::DEFAULT_LOG_LEVEL_THRESHOLD = UINT8_MAX
static

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


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