ezEngine Release 25.08
Loading...
Searching...
No Matches
ezLogEntryDelegate Class Reference

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

#include <LogEntry.h>

Inheritance diagram for ezLogEntryDelegate:

Public Types

using Callback = ezDelegate< void(ezLogEntry &)>
 

Public Member Functions

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

Detailed Description

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

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

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

Member Function Documentation

◆ HandleLogMessage()

void ezLogEntryDelegate::HandleLogMessage ( const ezLoggingEventData le)
overridevirtual

Override this function to handle logging events.

Implements ezLogInterface.


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