openDAQ
Open data acquisition platform
Logger component
+ Collaboration diagram for Logger component:

Detailed Description

Modules

 Factories
 

Classes

struct  ILoggerComponent
 Logs messages produced by a specific part of openDAC SDK. The messages are written into the Logger Sinks associated with the Logger Component object. More...
 
class  LoggerComponentPtr
 Logs messages produced by a specific part of openDAC SDK. The messages are written into the Logger Sinks associated with the Logger Component object. More...
 

Functions

daq::StringPtr getName () const
 Gets the name of the component. More...
 
void setLevel (daq::LogLevel level) const
 Sets the minimal severity level of messages to be logged by the component. More...
 
daq::LogLevel getLevel () const
 Gets the minimal severity level of messages to be logged by the component. More...
 
void logMessage (daq::SourceLocation location, daq::ConstCharPtr msg, daq::LogLevel level) const
 Logs a message with the provided source location and severity level. More...
 
void setPattern (const daq::StringPtr &pattern) const
 Sets the custom formatter pattern for the component. More...
 
daq::Bool shouldLog (daq::LogLevel level) const
 Checks whether the messages with given log severity level will be logged or not. More...
 
void flush () const
 Triggers writing out the messages stored in temporary buffers.
 
void flushOnLevel (daq::LogLevel level) const
 Sets the minimum severity level of messages to be automatically written to the associated sinks bypassing the temporary buffers. More...
 

Function Documentation

◆ flushOnLevel()

void flushOnLevel ( daq::LogLevel  level) const
inline

Sets the minimum severity level of messages to be automatically written to the associated sinks bypassing the temporary buffers.

Parameters
levelThe severity level of messages.

◆ getLevel()

daq::LogLevel getLevel ( ) const
inline

Gets the minimal severity level of messages to be logged by the component.

Returns
The log severity level of the component.

◆ getName()

daq::StringPtr getName ( ) const
inline

Gets the name of the component.

Returns
The name of the component.

◆ logMessage()

void logMessage ( daq::SourceLocation  location,
daq::ConstCharPtr  msg,
daq::LogLevel  level 
) const
inline

Logs a message with the provided source location and severity level.

Parameters
locationThe source location.
msgThe message.
levelThe severity level of the message.

◆ setLevel()

void setLevel ( daq::LogLevel  level) const
inline

Sets the minimal severity level of messages to be logged by the component.

Parameters
levelThe log severity level of the component.

◆ setPattern()

void setPattern ( const daq::StringPtr &  pattern) const
inline

Sets the custom formatter pattern for the component.

Parameters
patternThe format pattern string.

◆ shouldLog()

daq::Bool shouldLog ( daq::LogLevel  level) const
inline

Checks whether the messages with given log severity level will be logged or not.

Parameters
levelThe severity level of messages.
Returns
True if the messages with level will be logged within the component; false otherwise.