Represents a collection of Logger Components with multiple Logger Sinks and a single Logger Thread Pool shared between components. More...
Represents a collection of Logger Components with multiple Logger Sinks and a single Logger Thread Pool shared between components.
Logger is used to create, manage and maintain Logger Components associated with different parts of the openDAQ SDK. The Logger provides methods, allowing for components to be added and removed dynamically. The components added within the same Logger object should have unique names. Each newly added component inherits threshold log severity level from the Logger. Then this level can be changed independently per component. The set of sinks is initialized on the Logger object creation and cannot be changed after.
Additionally, Logger provides the ability to manage flushing policies for the added components, see flushOnLevel
method.
Public Member Functions | |
virtual ErrCode INTERFACE_FUNC | setLevel (LogLevel level)=0 |
Sets the default log severity level. More... | |
virtual ErrCode INTERFACE_FUNC | getLevel (LogLevel *level)=0 |
Gets the default log severity level. More... | |
virtual ErrCode INTERFACE_FUNC | getOrAddComponent (IString *name, ILoggerComponent **component)=0 |
Gets an added component by name or creates a new one with a given name and adds it to the Logger object. More... | |
virtual ErrCode INTERFACE_FUNC | addComponent (IString *name, ILoggerComponent **component)=0 |
Creates a component with a given name and adds it to the Logger object. More... | |
virtual ErrCode INTERFACE_FUNC | removeComponent (IString *name)=0 |
Removes the component with a given name from the Logger object. More... | |
virtual ErrCode INTERFACE_FUNC | getComponents (IList **components)=0 |
Gets a list of added components. More... | |
virtual ErrCode INTERFACE_FUNC | getComponent (IString *name, ILoggerComponent **component)=0 |
Gets an added component by name. More... | |
virtual ErrCode INTERFACE_FUNC | flush ()=0 |
Triggers writing out the messages stored in temporary buffers for added components and sinks associated with the Logger object. | |
virtual ErrCode INTERFACE_FUNC | flushOnLevel (LogLevel level)=0 |
Sets the minimum severity level of messages to be automatically flushed by components of Logger object. More... | |
![]() | |
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... | |
![]() | |
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... | |
|
pure virtual |
Creates a component with a given name and adds it to the Logger object.
name | The component's name. | |
[out] | component | Added component. |
OPENDAQ_ERR_INVALIDPARAMETER | if name is empty string. |
Sets the minimum severity level of messages to be automatically flushed by components of Logger object.
level | The log severity level. |
|
pure virtual |
Gets an added component by name.
name | The component's name. | |
[out] | component | The logger component with the name equal to . |
OPENDAQ_ERR_NOTFOUND | if a component with the specified name was not added. |
Gets a list of added components.
[out] | components | The list of added components. |
Gets the default log severity level.
[out] | level | The log severity level. |
|
pure virtual |
Gets an added component by name or creates a new one with a given name and adds it to the Logger object.
name | The component's name. | |
[out] | component | The logger component with the name equal to . |
OPENDAQ_ERR_INVALIDPARAMETER | if name is empty string. |
Removes the component with a given name from the Logger object.
name | The component's name. |
OPENDAQ_ERR_NOTFOUND | if a component with the specified name was not added. |