API Documentation
Public Member Functions | List of all members
nkLog::Logger Class Referenceabstract

An interface to make all logging capabilities central. More...

Inheritance diagram for nkLog::Logger:
nkLog::ConsoleLogger nkLog::FileLogger

Public Member Functions

 Logger () noexcept
 
virtual ~Logger ()
 
virtual void log (StringView message, StringView className)=0
 

Detailed Description

An interface to make all logging capabilities central.

A client will inherit from this class and override the log method to output messages wherever is needed. This class is the base of all loggers within the library. Using it, it is possible to reroute all messages logged by the engine as a whole, component per component.

Constructor & Destructor Documentation

◆ Logger()

nkLog::Logger::Logger ( )
noexcept

Constructor.

◆ ~Logger()

virtual nkLog::Logger::~Logger ( )
virtual

Destructor.

Member Function Documentation

◆ log()

virtual void nkLog::Logger::log ( StringView  message,
StringView  className 
)
pure virtual

The method called when a message has been logged. This method is the one to be implemented by the client code.

Parameters
messageThe message to log.
classNameA bonus information to help giving context for the message that has been logged. Typically, it will be the class name (a message from Texture unable to load for instance).

Implemented in nkLog::FileLogger, and nkLog::ConsoleLogger.


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