Boboter
Loading...
Searching...
No Matches
logger.h File Reference
#include <esp_log.h>
#include <freertos/FreeRTOS.h>
#include "include/flags.h"

Go to the source code of this file.

Classes

class  Logger
struct  Logger::log_item

Macros

#define LOGV(format, ...)
 Macro for verbose logging.
#define LOGD(format, ...)
 Macro for debug logging.
#define LOGI(format, ...)
 Macro for info logging.
#define LOGW(format, ...)
 Macro for warn logging.
#define LOGE(format, ...)
 Macro for error logging.

Detailed Description

Authors
MarioS271

Macro Definition Documentation

◆ LOGD

#define LOGD ( format,
... )
Value:
do { \
if constexpr (Flags::LOWEST_LOG_LEVEL >= ESP_LOG_DEBUG) { \
Logger::get_instance().custom_log(ESP_LOG_DEBUG, TAG, format, ##__VA_ARGS__); \
} \
} while (0)
constexpr const char * TAG
Definition _rgb_leds_task.cpp:16
constexpr esp_log_level_t LOWEST_LOG_LEVEL
Enable logging of debug messages.
Definition flags.h:39

Macro for debug logging.

Checks if the log level allows debug logs

Parameters
formatThe format string to use (printf-style)
...The variadic argument list of the format string

◆ LOGE

#define LOGE ( format,
... )
Value:
do { \
if constexpr (Flags::LOWEST_LOG_LEVEL >= ESP_LOG_ERROR) { \
Logger::get_instance().custom_log(ESP_LOG_ERROR, TAG, format, ##__VA_ARGS__); \
} \
} while (0)

Macro for error logging.

Checks if the log level allows error logs

Parameters
formatThe format string to use (printf-style)
...The variadic argument list of the format string

◆ LOGI

#define LOGI ( format,
... )
Value:
do { \
if constexpr (Flags::LOWEST_LOG_LEVEL >= ESP_LOG_INFO) { \
Logger::get_instance().custom_log(ESP_LOG_INFO, TAG, format, ##__VA_ARGS__); \
} \
} while (0)

Macro for info logging.

Checks if the log level allows info logs

Parameters
formatThe format string to use (printf-style)
...The variadic argument list of the format string

◆ LOGV

#define LOGV ( format,
... )
Value:
do { \
if constexpr (Flags::LOWEST_LOG_LEVEL >= ESP_LOG_VERBOSE) { \
if constexpr (Flags::ENABLED_VERBOSE_LOG_SOURCES & LOG_SOURCE) { \
Logger::get_instance().custom_log(ESP_LOG_VERBOSE, TAG, format, ##__VA_ARGS__); \
} \
} \
} while (0)
constexpr uint32_t ENABLED_VERBOSE_LOG_SOURCES
Enable specific modules to output verbose logs.
Definition flags.h:45

Macro for verbose logging.

Checks if the log level allows verbose logs and if the module which is attempting to log is included in Flags::ENABLED_VERBOSE_LOG_SOURCES

Parameters
formatThe format string to use (printf-style)
...The variadic argument list of the format string

◆ LOGW

#define LOGW ( format,
... )
Value:
do { \
if constexpr (Flags::LOWEST_LOG_LEVEL >= ESP_LOG_WARN) { \
Logger::get_instance().custom_log(ESP_LOG_WARN, TAG, format, ##__VA_ARGS__); \
} \
} while (0)

Macro for warn logging.

Checks if the log level allows warn logs

Parameters
formatThe format string to use (printf-style)
...The variadic argument list of the format string