3D Graphics Engine for ESP32
 
Loading...
Searching...
No Matches
Ragot::Logger Class Reference

Singleton logger class for the Ragot engine. More...

#include <Logger.hpp>

Collaboration diagram for Ragot::Logger:
Collaboration graph

Public Member Functions

template<typename... Args>
void Log (const char *TAG, uint8_t level, const char *fmt, Args... args)
 Logs a message with the specified tag and level.
 
void setLogLevel (uint8_t level)
 Sets the log level for the logger.
 
uint8_t getLogLevel () const
 Gets the current log level of the logger.
 

Static Public Member Functions

static Loggerinstance ()
 Gets the singleton instance of the Logger class.
 

Private Member Functions

 Logger ()=default
 Default constructor for the Logger class.
 
 ~Logger ()=default
 Default destructor for the Logger class.
 
 Logger (const Logger &)=delete
 Construct a new Logger object (Deleted).
 
 Logger (const Logger &&)=delete
 Construct a new Logger object (Deleted).
 
Loggeroperator= (const Logger &)=delete
 Assignment operator for the Logger class (Deleted).
 
Loggeroperator= (const Logger &&)=delete
 Assignment operator for the Logger class (Deleted).
 

Private Attributes

uint8_t logLevel = 0
 Current log level for the logger.
 

Detailed Description

Singleton logger class for the Ragot engine.

This class provides a singleton logger that allows logging messages with different severity levels (INFO, WARNING, ERROR). It supports formatted logging using printf-style format strings and can be used across different platforms.

Constructor & Destructor Documentation

◆ Logger() [1/3]

Ragot::Logger::Logger ( )
privatedefault

Default constructor for the Logger class.

This constructor is private to enforce the singleton pattern.

Here is the caller graph for this function:

◆ ~Logger()

Ragot::Logger::~Logger ( )
privatedefault

Default destructor for the Logger class.

This destructor is defaulted and does not perform any special cleanup.

◆ Logger() [2/3]

Ragot::Logger::Logger ( const Logger & )
privatedelete

Construct a new Logger object (Deleted).

Here is the call graph for this function:

◆ Logger() [3/3]

Ragot::Logger::Logger ( const Logger && )
privatedelete

Construct a new Logger object (Deleted).

This constructor is deleted to prevent moving the Logger instance.

Here is the call graph for this function:

Member Function Documentation

◆ getLogLevel()

uint8_t Ragot::Logger::getLogLevel ( ) const
inline

Gets the current log level of the logger.

This method returns the current log level, which determines the severity of messages that will be logged.

Returns
uint8_t The current log level (0 = INFO, 1 = WARNING, 2 = ERROR).

◆ instance()

static Logger & Ragot::Logger::instance ( )
inlinestatic

Gets the singleton instance of the Logger class.

This method returns a reference to the singleton Logger instance.

Returns
Logger& Reference to the singleton Logger instance.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Log()

template<typename... Args>
void Ragot::Logger::Log ( const char * TAG,
uint8_t level,
const char * fmt,
Args... args )
inline

Logs a message with the specified tag and level.

This method logs a message with the given tag and severity level. The message can be formatted using printf-style format strings.

Parameters
TAGThe tag for the log message.
levelThe severity level of the log message (0 = INFO, 1 = WARNING, 2 = ERROR).
fmtThe format string for the log message.
argsThe arguments to format the log message.

◆ operator=() [1/2]

Logger & Ragot::Logger::operator= ( const Logger && )
privatedelete

Assignment operator for the Logger class (Deleted).

This operator is deleted to prevent moving Logger instances.

Returns
Logger& Reference to the current object.
Here is the call graph for this function:

◆ operator=() [2/2]

Logger & Ragot::Logger::operator= ( const Logger & )
privatedelete

Assignment operator for the Logger class (Deleted).

This operator is deleted to prevent assignment of Logger instances.

Returns
Logger& Reference to the current object.
Here is the call graph for this function:

◆ setLogLevel()

void Ragot::Logger::setLogLevel ( uint8_t level)
inline

Sets the log level for the logger.

This method sets the log level for the logger, which determines the severity of messages that will be logged. It also configures the ESP-IDF logging system if running on an ESP platform.

Parameters
levelThe new log level to set (0 = INFO, 1 = WARNING, 2 = ERROR).

Member Data Documentation

◆ logLevel

uint8_t Ragot::Logger::logLevel = 0
private

Current log level for the logger.

This variable stores the current log level, which determines the severity of messages that will be logged. 0 = INFO, 1 = WARNING, 2 = ERROR.


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