Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::core::LogHandler Class Referenceabstract

Handles log messages. More...

#include <OxygenEngine/core/logger.h>

Inheritance diagram for oe::core::LogHandler:
[legend]
Collaboration diagram for oe::core::LogHandler:
[legend]

Public Member Functions

virtual void write (const std::string &message, const LogLevel level)=0
 Do actions when the logger need to write a message.
 
virtual bool canWrite (const LogLevel level, const LogVerbosity verbosity)
 Check if the handler will write according to the the level and verbosity.
 

Public Attributes

bool write_stdout = true
 Indicate to the handler that the message should be sent to stdout / stderr.
 
bool write_file = false
 Indicate to the handler that the message should be written in a file.
 

Protected Attributes

Logger_logger = nullptr
 Logger instance bound to this handler.
 

Friends

class Logger
 

Detailed Description

Handles log messages.

This class is used to take the log messages and send them to ... anything you want

See also
DefaultLogHandler for the handler that send log messages to stdout

Member Function Documentation

◆ canWrite()

virtual bool oe::core::LogHandler::canWrite ( const LogLevel  level,
const LogVerbosity  verbosity 
)
inlinevirtual

Check if the handler will write according to the the level and verbosity.

Note
This function is not set as const to allow user overrides' to change behavior / internal state based on level / verbosity
In fact, with creativity you can do anything with the verbosity flags
Parameters
levelLog level
verbosityLog verbosity
Returns
Let the log to be written or not by this handler

◆ write()

virtual void oe::core::LogHandler::write ( const std::string &  message,
const LogLevel  level 
)
pure virtual

Do actions when the logger need to write a message.

Parameters
messageMessage sent by the logger
levelLevel of log sent by the logger

Implemented in oe::core::DefaultLogHandler.


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