Plasma Engine  2.0
Loading...
Searching...
No Matches
plLogEntryDelegate Class Reference

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

#include <LogEntry.h>

Inheritance diagram for plLogEntryDelegate:

Public Types

using Callback = plDelegate<void(plLogEntry&)>
 

Public Member Functions

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

Detailed Description

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

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

{
plLogEntryDelegate logger(([&array](plLogEntry& entry) -> void
{
array.PushBack(std::move(entry));
}));
plLogSystemScope logScope(&logger);
*log something*
}
A log interface implementation that converts a log event into a plLogEntry and calls a delegate with ...
Definition LogEntry.h:42
A class that sets a custom plLogInterface as the thread local default log system, and resets the prev...
Definition Log.h:424
A persistent log entry created from a plLoggingEventData. Allows for a log event to survive for longe...
Definition LogEntry.h:14

Member Function Documentation

◆ HandleLogMessage()

void plLogEntryDelegate::HandleLogMessage ( const plLoggingEventData & le)
overridevirtual

Override this function to handle logging events.

Implements plLogInterface.


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