openDAQ
Open data acquisition platform
ILoggerSink Struct Referenceabstract

Represents the object that actually writes the log messages to the target. Each Logger Sink is responsible for only single target: file, console etc. More...

+ Inheritance diagram for ILoggerSink:
+ Collaboration diagram for ILoggerSink:

Detailed Description

Represents the object that actually writes the log messages to the target. Each Logger Sink is responsible for only single target: file, console etc.

Logger Sink allows to set up a threshold log severity level, so the messages with lower level will not be written to the target.

Additionally, it provides the ability to customize format for messages written to the target, see setPattern method.

Public Member Functions

virtual ErrCode INTERFACE_FUNC setLevel (LogLevel level)=0
 Sets the minimal severity level of messages to be written to the target. More...
 
virtual ErrCode INTERFACE_FUNC getLevel (LogLevel *level)=0
 Gets the minimal severity level of messages to be written to the target. More...
 
virtual ErrCode INTERFACE_FUNC shouldLog (LogLevel level, Bool *willLog)=0
 Checks whether the messages with given log severity level will be written to the target or not. More...
 
virtual ErrCode INTERFACE_FUNC setPattern (IString *pattern)=0
 Sets the custom formatter pattern for the sink. More...
 
virtual ErrCode INTERFACE_FUNC flush ()=0
 Triggers writing out the messages from temporary buffers to the target.
 
- 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

◆ getLevel()

virtual ErrCode INTERFACE_FUNC getLevel ( LogLevel level)
pure virtual

Gets the minimal severity level of messages to be written to the target.

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

◆ setLevel()

virtual ErrCode INTERFACE_FUNC setLevel ( LogLevel  level)
pure virtual

Sets the minimal severity level of messages to be written to the target.

Parameters
levelThe log severity level of the sink.

◆ setPattern()

virtual ErrCode INTERFACE_FUNC setPattern ( IString pattern)
pure virtual

Sets the custom formatter pattern for the sink.

Parameters
patternThe formatter 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 written to the target or not.

Parameters
levelThe severity level of messages.
[out]willLogTrue if the messages with level will be written to the target; false otherwise.