LiteFX 0.4.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
LiteFX::Logging::Log Class Reference

A log to which messages are written to. More...

#include <logging.hpp>

Classes

class  LogImpl
 

Public Member Functions

 Log (const String &name)
 Creates a new log instance.
 
virtual ~Log () noexcept
 
 Log (Log &&) noexcept=delete
 
 Log (const Log &)=delete
 
auto operator= (Log &&) noexcept=delete
 
auto operator= (const Log &)=delete
 
virtual const StringgetName () const noexcept
 Gets the name of the logger.
 
template<typename ... TArgs>
void log (LogLevel level, std::format_string< TArgs... > format, TArgs &&... args)
 Logs a message of level with format .
 
template<typename ... TArgs>
void trace (std::format_string< TArgs... > format, TArgs &&... args)
 Logs a trace message with format .
 
template<typename ... TArgs>
void debug (std::format_string< TArgs... > format, TArgs &&... args)
 Logs a debug message with format .
 
template<typename ... TArgs>
void info (std::format_string< TArgs... > format, TArgs &&... args)
 Logs an info message with format .
 
template<typename ... TArgs>
void warning (std::format_string< TArgs... > format, TArgs &&... args)
 Logs a warning message with format .
 
template<typename ... TArgs>
void error (std::format_string< TArgs... > format, TArgs &&... args)
 Logs an error message with format .
 
template<typename ... TArgs>
void fatal (std::format_string< TArgs... > format, TArgs &&... args)
 Logs a fatal error message with format .
 

Protected Member Functions

virtual void log (LogLevel level, StringView message)
 

Detailed Description

A log to which messages are written to.

Note that in release builds, message at LogLevel::Trace and LogLevel::Debug are not forwarded and the corresponding functions are disabled. If you really want to log such messages, you have to specify the log level explicitly by calling Log::log.

Constructor & Destructor Documentation

◆ Log() [1/3]

Log::Log ( const String & name)

Creates a new log instance.

Parameters
nameThe name of the log.

◆ ~Log()

Log::~Log ( )
virtualdefaultnoexcept

◆ Log() [2/3]

LiteFX::Logging::Log::Log ( Log && )
deletenoexcept

◆ Log() [3/3]

LiteFX::Logging::Log::Log ( const Log & )
delete

Member Function Documentation

◆ debug()

template<typename ... TArgs>
void LiteFX::Logging::Log::debug ( std::format_string< TArgs... > format,
TArgs &&... args )
inline

Logs a debug message with format .

Parameters
formatThe format of the message.

◆ error()

template<typename ... TArgs>
void LiteFX::Logging::Log::error ( std::format_string< TArgs... > format,
TArgs &&... args )
inline

Logs an error message with format .

Parameters
formatThe format of the message.

◆ fatal()

template<typename ... TArgs>
void LiteFX::Logging::Log::fatal ( std::format_string< TArgs... > format,
TArgs &&... args )
inline

Logs a fatal error message with format .

Parameters
formatThe format of the message.

◆ getName()

const String & Log::getName ( ) const
virtualnoexcept

Gets the name of the logger.

◆ info()

template<typename ... TArgs>
void LiteFX::Logging::Log::info ( std::format_string< TArgs... > format,
TArgs &&... args )
inline

Logs an info message with format .

Parameters
formatThe format of the message.

◆ log() [1/2]

template<typename ... TArgs>
void LiteFX::Logging::Log::log ( LogLevel level,
std::format_string< TArgs... > format,
TArgs &&... args )
inline

Logs a message of level with format .

Parameters
levelThe log level of the message.
formatThe format of the message.

◆ log() [2/2]

void Log::log ( LogLevel level,
StringView message )
protectedvirtual

◆ operator=() [1/2]

auto LiteFX::Logging::Log::operator= ( const Log & )
delete

◆ operator=() [2/2]

auto LiteFX::Logging::Log::operator= ( Log && )
deletenoexcept

◆ trace()

template<typename ... TArgs>
void LiteFX::Logging::Log::trace ( std::format_string< TArgs... > format,
TArgs &&... args )
inline

Logs a trace message with format .

Parameters
formatThe format of the message.

◆ warning()

template<typename ... TArgs>
void LiteFX::Logging::Log::warning ( std::format_string< TArgs... > format,
TArgs &&... args )
inline

Logs a warning message with format .

Parameters
formatThe format of the message.