Etterna 0.75.1
Loading...
Searching...
No Matches
Core::ILogger Class Referenceabstract

#include <ILogger.hpp>

Inheritance diagram for Core::ILogger:

Public Types

enum class  Severity {
  TRACE , DEBUG , INFO , WARN ,
  ERR , FATAL
}

Public Member Functions

virtual ~ILogger ()=default
template<typename... Args>
void trace (fmt::format_string< Args... > log, Args &&... args)
template<typename... Args>
void debug (fmt::format_string< Args... > log, Args &&... args)
template<typename... Args>
void info (fmt::format_string< Args... > log, Args &&... args)
template<typename... Args>
void warn (fmt::format_string< Args... > log, Args &&... args)
template<typename... Args>
void error (fmt::format_string< Args... > log, Args &&... args)
template<typename... Args>
void fatal (fmt::format_string< Args... > log, Args &&... args)
virtual void setLogLevel (ILogger::Severity logLevel)=0
virtual std::string getLogFile ()=0

Protected Member Functions

virtual void log (ILogger::Severity logLevel, const std::string_view message)=0

Detailed Description

A logger class to be implemented around a separate logging library. ILogger is what will be used throughout the game files.

The public functions defined in the class are templates which use the format library to insert the extra parameters into the final string. To simplify operation for the backend, they receive the final formatted string in the log parameter, at which point they can log with it as is desired.

Member Enumeration Documentation

◆ Severity

enum class Core::ILogger::Severity
strong

Severity Enum - Middle man between each logging backed and their own severity terminology.

Constructor & Destructor Documentation

◆ ~ILogger()

virtual Core::ILogger::~ILogger ( )
virtualdefault

Virtual destructor to ensure derived objects are guaranteed to have destructor

Member Function Documentation

◆ log()

virtual void Core::ILogger::log ( ILogger::Severity logLevel,
const std::string_view message )
protectedpure virtual

Implementations only need to implement this log function to send logs to file, console, network, etc. This function is kept protected as for the majority of logs, the six severity functions should be sufficient for most logging purposes.

Parameters
logLevelLog Severity
messageFormatted string to log

The documentation for this class was generated from the following file:
  • /home/runner/work/etterna/etterna/src/Core/Services/ILogger.hpp