MIRA
|
Single instance of the core logging class. More...
#include <error/LoggingCore.h>
Public Types | |
typedef boost::function< void(SeverityLevel)> | SeverityLevelChangedCallback |
Signature of a callback function for log severity level changes. More... | |
typedef Base::Type | Type |
Public Member Functions | |
LogCore () | |
The Constructor. More... | |
LogRecordFunctionInfo | parseFunction (const LogRecord &record) |
Parses the log record and extracts namespace, class name and function. More... | |
void | setSeverityLevel (SeverityLevel level) |
Sets the application wide severity level. More... | |
SeverityLevel | getSeverityLevel () const |
Get the application wide severity level. More... | |
uint32 | registerCallback (SeverityLevelChangedCallback callback) |
Register a callback function. More... | |
void | unregisterCallback (uint32 id) |
Unregister a callback function. More... | |
Duration | getUptime () const |
Get the up-time of the core. More... | |
template<typename T > | |
LogSinkPtr | registerSink (const T &sink) |
Register a new sink. More... | |
void | unregisterSink (LogSinkPtr sink) |
Unregisters a sink. More... | |
void | log (LogRecord &record) |
Writes a log record and distribute it between all the registered sinks. More... | |
Static Public Member Functions | |
static Type & | instance () |
Returns a reference to the singleton instance. More... | |
static bool | isDestroyed () |
Returns true, if the singleton was already destroyed. More... | |
Static Protected Member Functions | |
static Type * | makeInstance () |
static void | destroyInstance (void) |
Single instance of the core logging class.
This class takes log records and distributes them between all registered sinks.
typedef boost::function<void(SeverityLevel)> SeverityLevelChangedCallback |
Signature of a callback function for log severity level changes.
|
inherited |
LogCore | ( | ) |
The Constructor.
LogRecordFunctionInfo parseFunction | ( | const LogRecord & | record | ) |
Parses the log record and extracts namespace, class name and function.
record | The record that will be parsed |
|
inline |
Sets the application wide severity level.
level | The new level. |
|
inline |
Get the application wide severity level.
|
inline |
Register a callback function.
The callback is called after the log severity level is changed by a call to setSeverityLevel.
|
inline |
Unregister a callback function.
|
inline |
Get the up-time of the core.
|
inline |
Register a new sink.
The sinks consume method is called upon a new log entry. Note: The sink must be copy constructible and inherited from LogSink.
sink | The sink to add. |
|
inline |
Unregisters a sink.
sink | The sink that will be unregistered. |
|
inline |
Writes a log record and distribute it between all the registered sinks.
Never call this method directly. Use the macros MIRA_LOG, MIRA_LOG_ATTR or MIRA_LOG_EXCEPTION instead.
record | The log record. |
|
inlinestaticinherited |
Returns a reference to the singleton instance.
XSingleton | If the singleton was already destroyed (dead reference) or not yet created (when using ExplicitInstantiation). |
|
inlinestaticinherited |
Returns true, if the singleton was already destroyed.
Trying to access it will result in an exception.
|
inlinestaticprotectedinherited |
|
inlinestaticprotectedinherited |