openDAQ
Open data acquisition platform
ILoggerComponent Struct Referenceabstract

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

+ Inheritance diagram for ILoggerComponent:
+ Collaboration diagram for ILoggerComponent:

Detailed Description

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

The set of associated sinks is initialized on the Logger Component object creation and cannot be changed after.

Logger Component allows to set up a threshold log severity level, so the messages with lower level will not be registered. Additionally, it provides the ability to trigger writing out messages stored in temporary buffers or set up the minimum severity level of messages to be written out automatically, see flushOnLevel method.

Public Member Functions

virtual ErrCode INTERFACE_FUNC getName (IString **name)=0
 Gets the name of the component. More...
 
virtual ErrCode INTERFACE_FUNC setLevel (LogLevel level)=0
 Sets the minimal severity level of messages to be logged by the component. More...
 
virtual ErrCode INTERFACE_FUNC getLevel (LogLevel *level)=0
 Gets the minimal severity level of messages to be logged by the component. More...
 
virtual ErrCode INTERFACE_FUNC logMessage (SourceLocation location, ConstCharPtr msg, LogLevel level)=0
 Logs a message with the provided source location and severity level. More...
 
virtual ErrCode INTERFACE_FUNC setPattern (IString *pattern)=0
 Sets the custom formatter pattern for the component. More...
 
virtual ErrCode INTERFACE_FUNC shouldLog (LogLevel level, Bool *willLog)=0
 Checks whether the messages with given log severity level will be logged or not. More...
 
virtual ErrCode INTERFACE_FUNC flush ()=0
 Triggers writing out the messages stored in temporary buffers.
 
virtual ErrCode INTERFACE_FUNC flushOnLevel (LogLevel level)=0
 Sets the minimum severity level of messages to be automatically written to the associated sinks bypassing the temporary buffers. More...
 
- Public Member Functions inherited from IBaseObject
virtual ErrCode INTERFACE_FUNC borrowInterface (const IntfID &intfID, void **obj) const =0
 Returns another interface which is supported by the object without incrementing the reference count. More...
 
virtual ErrCode INTERFACE_FUNC dispose ()=0
 Disposes all references held by the object. More...
 
virtual ErrCode INTERFACE_FUNC getHashCode (SizeT *hashCode)=0
 Returns hash code of the object. More...
 
virtual ErrCode INTERFACE_FUNC equals (IBaseObject *other, Bool *equal) const =0
 Compares object to another object for equality. More...
 
virtual ErrCode INTERFACE_FUNC toString (CharPtr *str)=0
 Returns a string representation of the object. More...
 
- Public Member Functions inherited from IUnknown
virtual ErrCode INTERFACE_FUNC queryInterface (const IntfID &intfID, void **obj)=0
 Returns another interface which is supported by the object and increments the reference count. More...
 
virtual int INTERFACE_FUNC addRef ()=0
 Increments the reference count for an interface on an object. More...
 
virtual int INTERFACE_FUNC releaseRef ()=0
 Decrements the reference count for an interface on an object. More...
 

Member Function Documentation

◆ flushOnLevel()

virtual ErrCode INTERFACE_FUNC flushOnLevel ( LogLevel  level)
pure virtual

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

virtual ErrCode INTERFACE_FUNC getLevel ( LogLevel level)
pure virtual

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

Parameters
[out]levelThe log severity level of the component.

◆ getName()

virtual ErrCode INTERFACE_FUNC getName ( IString **  name)
pure virtual

Gets the name of the component.

Parameters
[out]nameThe name of the component.

◆ logMessage()

virtual ErrCode INTERFACE_FUNC logMessage ( SourceLocation  location,
ConstCharPtr  msg,
LogLevel  level 
)
pure virtual

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

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

◆ setLevel()

virtual ErrCode INTERFACE_FUNC setLevel ( LogLevel  level)
pure virtual

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

Parameters
levelThe log severity level of the component.

◆ setPattern()

virtual ErrCode INTERFACE_FUNC setPattern ( IString pattern)
pure virtual

Sets the custom formatter pattern for the component.

Parameters
patternThe format pattern string.

◆ shouldLog()

virtual ErrCode INTERFACE_FUNC shouldLog ( LogLevel  level,
Bool *  willLog 
)
pure virtual

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

Parameters
levelThe severity level of messages.
[out]willLogTrue if the messages with level will be logged within the component; false otherwise.