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

#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)
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:43
Definition Log.h:426
Definition LogEntry.h:16

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:
  • /home/runner/work/XII/XII/Source/Engine/Foundation/Logging/LogEntry.h
  • /home/runner/work/XII/XII/Source/Engine/Foundation/Logging/Implementation/LogEntry.cpp