XII Release 0.1.0
Loading...
Searching...
No Matches
xiiLogEntryDelegate Class Reference

A log interface implementation that converts a log event into a xiiLogEntry and calls a delegate with it. More...

#include <LogEntry.h>

Inheritance diagram for xiiLogEntryDelegate:
[legend]

Public Types

using Callback = xiiDelegate<void(xiiLogEntry&)>
 

Public Member Functions

 xiiLogEntryDelegate (Callback callback, xiiLogMsgType::Enum logLevel=xiiLogMsgType::All)
 Log events will be delegated to the given callback.
 
virtual void HandleLogMessage (const xiiLoggingEventData &le) override
 Override this function to handle logging events.
 
- Public Member Functions inherited from xiiLogInterface
XII_ALWAYS_INLINE void SetLogLevel (xiiLogMsgType::Enum logLevel)
 LogLevel is between xiiLogEventType::None and xiiLogEventType::All and defines which messages will be logged and which will be filtered out.
 
XII_ALWAYS_INLINE xiiLogMsgType::Enum GetLogLevel ()
 Returns the currently set log level.
 

Detailed Description

A log interface implementation that converts a log event into a xiiLogEntry and calls a delegate with it.

A typical use case is to re-route and store log messages in a scope:

{
xiiLogEntryDelegate logger(([&array](xiiLogEntry& entry) -> void
{
array.PushBack(std::move(entry));
}));
xiiLogSystemScope logScope(&logger);
*log something*
}
xiiLogEntryDelegate(Callback callback, xiiLogMsgType::Enum logLevel=xiiLogMsgType::All)
Log events will be delegated to the given callback.
Definition LogEntry.cpp:41
A class that sets a custom xiiLogInterface as the thread local default log system,...
Definition Log.h:424
A persistent log entry created from a xiiLoggingEventData. Allows for a log event to survive for long...
Definition LogEntry.h:14

Member Function Documentation

◆ HandleLogMessage()

void xiiLogEntryDelegate::HandleLogMessage ( const xiiLoggingEventData & le)
overridevirtual

Override this function to handle logging events.

Implements xiiLogInterface.


The documentation for this class was generated from the following files: