|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
Type-safe logging with std::format. More...
#include "sdkconfig.h"#include <algorithm>#include <cstddef>#include <cstdint>#include <esp_log.h>#include <format>#include <string>#include <string_view>#include <utility>Go to the source code of this file.
Classes | |
| class | idfxx::log::logger |
| Lightweight logger bound to a specific tag. More... | |
Namespaces | |
| namespace | idfxx |
| namespace | idfxx::log |
Macros | |
| #define | IDFXX_LOGE(tag, fmt, ...) |
| Log at error level with zero-cost elimination when compile-time filtered. | |
| #define | IDFXX_LOGW(tag, fmt, ...) |
| Log at warning level with zero-cost elimination when compile-time filtered. | |
| #define | IDFXX_LOGI(tag, fmt, ...) |
| Log at info level with zero-cost elimination when compile-time filtered. | |
| #define | IDFXX_LOGD(tag, fmt, ...) |
| Log at debug level with zero-cost elimination when compile-time filtered. | |
| #define | IDFXX_LOGV(tag, fmt, ...) |
| Log at verbose level with zero-cost elimination when compile-time filtered. | |
Enumerations | |
| enum class | idfxx::log::level : uint8_t { idfxx::log::none = ESP_LOG_NONE , idfxx::log::error = ESP_LOG_ERROR , idfxx::log::warn = ESP_LOG_WARN , idfxx::log::info = ESP_LOG_INFO , idfxx::log::debug = ESP_LOG_DEBUG , idfxx::log::verbose = ESP_LOG_VERBOSE } |
| Log severity level. More... | |
Functions | |
| void | idfxx::log::log (level lvl, const char *tag, std::string_view msg) |
| Log a pre-formatted message at the specified level. | |
| template<typename... Args> | |
| void | idfxx::log::log (level lvl, const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at the specified level. | |
| template<typename... Args> | |
| void | idfxx::log::error (const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at error level. | |
| void | idfxx::log::error (const char *tag, std::string_view msg) |
| Log a pre-formatted message at error level. | |
| template<typename... Args> | |
| void | idfxx::log::warn (const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at warning level. | |
| void | idfxx::log::warn (const char *tag, std::string_view msg) |
| Log a pre-formatted message at warning level. | |
| template<typename... Args> | |
| void | idfxx::log::info (const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at info level. | |
| void | idfxx::log::info (const char *tag, std::string_view msg) |
| Log a pre-formatted message at info level. | |
| template<typename... Args> | |
| void | idfxx::log::debug (const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at debug level. | |
| void | idfxx::log::debug (const char *tag, std::string_view msg) |
| Log a pre-formatted message at debug level. | |
| template<typename... Args> | |
| void | idfxx::log::verbose (const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at verbose level. | |
| void | idfxx::log::verbose (const char *tag, std::string_view msg) |
| Log a pre-formatted message at verbose level. | |
| void | idfxx::log::set_level (const char *tag, level lvl) |
| Set the runtime log level for a specific tag. | |
| void | idfxx::log::set_default_level (level lvl) |
| Set the default log level for all tags. | |
| void | idfxx::log::buffer_hex (level lvl, const char *tag, const void *buffer, size_t length) |
| Log a buffer as hexadecimal bytes. | |
| void | idfxx::log::buffer_char (level lvl, const char *tag, const void *buffer, size_t length) |
| Log a buffer as printable characters. | |
| void | idfxx::log::buffer_hex_dump (level lvl, const char *tag, const void *buffer, size_t length) |
| Log a buffer as a formatted hex dump. | |
Type-safe logging with std::format.
Definition in file log.hpp.
| #define IDFXX_LOGD | ( | tag, | |
| fmt, | |||
| ... | |||
| ) |
Log at debug level with zero-cost elimination when compile-time filtered.
| tag | The log tag (a const char*). |
| fmt | A std::format format string. |
| ... | Arguments to format into the message. |
| #define IDFXX_LOGE | ( | tag, | |
| fmt, | |||
| ... | |||
| ) |
Log at error level with zero-cost elimination when compile-time filtered.
When LOG_LOCAL_LEVEL is set below ESP_LOG_ERROR, the compiler eliminates the entire log call including argument evaluation.
| tag | The log tag (a const char*). |
| fmt | A std::format format string. |
| ... | Arguments to format into the message. |
| #define IDFXX_LOGI | ( | tag, | |
| fmt, | |||
| ... | |||
| ) |
Log at info level with zero-cost elimination when compile-time filtered.
| tag | The log tag (a const char*). |
| fmt | A std::format format string. |
| ... | Arguments to format into the message. |
| #define IDFXX_LOGV | ( | tag, | |
| fmt, | |||
| ... | |||
| ) |
Log at verbose level with zero-cost elimination when compile-time filtered.
| tag | The log tag (a const char*). |
| fmt | A std::format format string. |
| ... | Arguments to format into the message. |
| #define IDFXX_LOGW | ( | tag, | |
| fmt, | |||
| ... | |||
| ) |
Log at warning level with zero-cost elimination when compile-time filtered.
| tag | The log tag (a const char*). |
| fmt | A std::format format string. |
| ... | Arguments to format into the message. |