EtcPal  HEAD (unstable)
ETC Platform Abstraction Layer (EtcPal)
View other versions:
LogMessageHandler Class Referenceabstract

Overview

An interface which handles log messages.

Users of the Logger class must provide a class that derives from LogMessageHandler to handle the Logger's output. LogMessageHandler has two jobs: getting a current timestamp to apply to log messages, and handling the final dispatched log message.

Public Member Functions

virtual LogTimestamp GetLogTimestamp ()
 Return a LogTimestamp representing the current local time. More...
 
virtual void HandleLogMessage (const EtcPalLogStrings &strings)=0
 Define this function to handle log messages and determine what to do with them. More...
 

Member Function Documentation

◆ GetLogTimestamp()

LogTimestamp GetLogTimestamp ( )
inlinevirtual

Return a LogTimestamp representing the current local time.

Optional; the default implementation does not append a timestamp to log messages.

◆ HandleLogMessage()

virtual void HandleLogMessage ( const EtcPalLogStrings strings)
pure virtual

Define this function to handle log messages and determine what to do with them.

If the corresponding Logger has a dispatch policy of LogDispatchPolicy::kDirect, this function is invoked directly from the context of the corresponding call to Log() or similar. In this case, be mindful of whether this function implementation has potential to block. If significant blocking is a possibility while handling log messages, consider using LogDispatchPolicy::kQueued.

Parameters
stringsStrings associated with the log message. Will contain valid strings corresponding to the log actions requested using Logger::SetLogAction().

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