|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
Classes | |
| class | logger |
| Lightweight logger bound to a specific tag. More... | |
Enumerations | |
| enum class | level : uint8_t { none = ESP_LOG_NONE , error = ESP_LOG_ERROR , warn = ESP_LOG_WARN , info = ESP_LOG_INFO , debug = ESP_LOG_DEBUG , verbose = ESP_LOG_VERBOSE } |
| Log severity level. More... | |
Functions | |
| void | log (level lvl, const char *tag, std::string_view msg) |
| Log a pre-formatted message at the specified level. | |
| template<typename... Args> | |
| void | log (level lvl, const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at the specified level. | |
| template<typename... Args> | |
| void | error (const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at error level. | |
| void | error (const char *tag, std::string_view msg) |
| Log a pre-formatted message at error level. | |
| template<typename... Args> | |
| void | warn (const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at warning level. | |
| void | warn (const char *tag, std::string_view msg) |
| Log a pre-formatted message at warning level. | |
| template<typename... Args> | |
| void | info (const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at info level. | |
| void | info (const char *tag, std::string_view msg) |
| Log a pre-formatted message at info level. | |
| template<typename... Args> | |
| void | debug (const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at debug level. | |
| void | debug (const char *tag, std::string_view msg) |
| Log a pre-formatted message at debug level. | |
| template<typename... Args> | |
| void | verbose (const char *tag, std::format_string< Args... > fmt, Args &&... args) |
| Log a message at verbose level. | |
| void | verbose (const char *tag, std::string_view msg) |
| Log a pre-formatted message at verbose level. | |
| void | set_level (const char *tag, level lvl) |
| Set the runtime log level for a specific tag. | |
| void | set_default_level (level lvl) |
| Set the default log level for all tags. | |
| void | buffer_hex (level lvl, const char *tag, const void *buffer, size_t length) |
| Log a buffer as hexadecimal bytes. | |
| void | buffer_char (level lvl, const char *tag, const void *buffer, size_t length) |
| Log a buffer as printable characters. | |
| void | buffer_hex_dump (level lvl, const char *tag, const void *buffer, size_t length) |
| Log a buffer as a formatted hex dump. | |
|
strong |
Log severity level.
Severity levels matching ESP-IDF's log levels, from most to least severe. Messages are only output when their level is at or above the configured threshold for the associated tag.
| void idfxx::log::buffer_char | ( | level | lvl, |
| const char * | tag, | ||
| const void * | buffer, | ||
| size_t | length | ||
| ) |
Log a buffer as printable characters.
Outputs the buffer contents as characters, 16 per line. Non-printable characters are not shown.
| lvl | The log severity level. |
| tag | The log tag identifying the source. |
| buffer | Pointer to the buffer data. |
| length | Number of bytes to log. |
Referenced by idfxx::log::logger::buffer_char().
| void idfxx::log::buffer_hex | ( | level | lvl, |
| const char * | tag, | ||
| const void * | buffer, | ||
| size_t | length | ||
| ) |
Log a buffer as hexadecimal bytes.
Outputs the buffer contents as hex values, 16 bytes per line.
| lvl | The log severity level. |
| tag | The log tag identifying the source. |
| buffer | Pointer to the buffer data. |
| length | Number of bytes to log. |
Referenced by idfxx::log::logger::buffer_hex().
| 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.
Outputs a hex dump with memory addresses, hex values, and ASCII representation, similar to the output of the xxd command.
| lvl | The log severity level. |
| tag | The log tag identifying the source. |
| buffer | Pointer to the buffer data. |
| length | Number of bytes to log. |
Referenced by idfxx::log::logger::buffer_hex_dump().
| void idfxx::log::debug | ( | const char * | tag, |
| std::format_string< Args... > | fmt, | ||
| Args &&... | args | ||
| ) |
|
inline |
| void idfxx::log::error | ( | const char * | tag, |
| std::format_string< Args... > | fmt, | ||
| Args &&... | args | ||
| ) |
|
inline |
| void idfxx::log::info | ( | const char * | tag, |
| std::format_string< Args... > | fmt, | ||
| Args &&... | args | ||
| ) |
|
inline |
| void idfxx::log::log | ( | level | lvl, |
| const char * | tag, | ||
| std::format_string< Args... > | fmt, | ||
| Args &&... | args | ||
| ) |
Log a message at the specified level.
The message is only formatted if the tag's runtime log level permits output at the specified severity. Format strings are validated at compile time.
| Args | Format argument types, deduced from the arguments. |
| lvl | The log severity level. |
| tag | The log tag identifying the source. |
| fmt | A std::format format string, validated at compile time. |
| args | Arguments to format into the message. |
Definition at line 88 of file log.hpp.
References log().
| void idfxx::log::log | ( | level | lvl, |
| const char * | tag, | ||
| std::string_view | msg | ||
| ) |
Log a pre-formatted message at the specified level.
The message is only output if the tag's runtime log level permits output at the specified severity. No format processing is performed on the message.
| lvl | The log severity level. |
| tag | The log tag identifying the source. |
| msg | The message string to log. |
References log().
Referenced by debug(), debug(), error(), error(), info(), info(), log(), log(), idfxx::log::logger::log(), idfxx::log::logger::log(), verbose(), verbose(), warn(), and warn().
| void idfxx::log::set_default_level | ( | level | lvl | ) |
Set the default log level for all tags.
Tags without a specific level configuration will use this default.
| lvl | The minimum severity level to output. |
| void idfxx::log::set_level | ( | const char * | tag, |
| level | lvl | ||
| ) |
Set the runtime log level for a specific tag.
Messages with a severity below the configured level are suppressed at runtime for the specified tag.
| tag | The log tag to configure. |
| lvl | The minimum severity level to output. |
| void idfxx::log::verbose | ( | const char * | tag, |
| std::format_string< Args... > | fmt, | ||
| Args &&... | args | ||
| ) |
|
inline |
| void idfxx::log::warn | ( | const char * | tag, |
| std::format_string< Args... > | fmt, | ||
| Args &&... | args | ||
| ) |