Singleton logger class for the Ragot engine. More...
#include <Logger.hpp>
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 Logger & | instance () |
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). | |
Logger & | operator= (const Logger &)=delete |
Assignment operator for the Logger class (Deleted). | |
Logger & | operator= (const Logger &&)=delete |
Assignment operator for the Logger class (Deleted). | |
Private Attributes | |
uint8_t | logLevel = 0 |
Current log level for the logger. | |
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.
|
privatedefault |
Default constructor for the Logger class.
This constructor is private to enforce the singleton pattern.
|
privatedefault |
Default destructor for the Logger class.
This destructor is defaulted and does not perform any special cleanup.
|
privatedelete |
|
privatedelete |
|
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.
|
inlinestatic |
|
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.
TAG | The tag for the log message. |
level | The severity level of the log message (0 = INFO, 1 = WARNING, 2 = ERROR). |
fmt | The format string for the log message. |
args | The arguments to format the log message. |
|
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.
level | The new log level to set (0 = INFO, 1 = WARNING, 2 = ERROR). |
|
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.