|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
Lightweight logger bound to a specific tag. More...
Public Member Functions | |
| constexpr | logger (const char *tag) noexcept |
| Construct a logger with the given tag. | |
| constexpr const char * | tag () const noexcept |
| Get the tag associated with this logger. | |
| template<typename... Args> | |
| void | log (level lvl, std::format_string< Args... > fmt, Args &&... args) const |
| Log a message at the specified level. | |
| void | log (level lvl, std::string_view msg) const |
| Log a pre-formatted message at the specified level. | |
| template<typename... Args> | |
| void | error (std::format_string< Args... > fmt, Args &&... args) const |
| Log a message at error level. | |
| void | error (std::string_view msg) const |
| Log a pre-formatted message at error level. | |
| template<typename... Args> | |
| void | warn (std::format_string< Args... > fmt, Args &&... args) const |
| Log a message at warning level. | |
| void | warn (std::string_view msg) const |
| Log a pre-formatted message at warning level. | |
| template<typename... Args> | |
| void | info (std::format_string< Args... > fmt, Args &&... args) const |
| Log a message at info level. | |
| void | info (std::string_view msg) const |
| Log a pre-formatted message at info level. | |
| template<typename... Args> | |
| void | debug (std::format_string< Args... > fmt, Args &&... args) const |
| Log a message at debug level. | |
| void | debug (std::string_view msg) const |
| Log a pre-formatted message at debug level. | |
| template<typename... Args> | |
| void | verbose (std::format_string< Args... > fmt, Args &&... args) const |
| Log a message at verbose level. | |
| void | verbose (std::string_view msg) const |
| Log a pre-formatted message at verbose level. | |
| void | set_level (level lvl) const |
| Set the runtime log level for this logger's tag. | |
| void | buffer_hex (level lvl, const void *buffer, size_t length) const |
| Log a buffer as hexadecimal bytes. | |
| void | buffer_char (level lvl, const void *buffer, size_t length) const |
| Log a buffer as printable characters. | |
| void | buffer_hex_dump (level lvl, const void *buffer, size_t length) const |
| Log a buffer as a formatted hex dump. | |
Lightweight logger bound to a specific tag.
A value type that associates a tag string with logging methods, avoiding repetition of the tag in every call. The tag pointer must remain valid for the lifetime of the logger (string literals are recommended).
|
inlineexplicitconstexprnoexcept |
|
inline |
Log a buffer as printable characters.
| lvl | The log severity level. |
| buffer | Pointer to the buffer data. |
| length | Number of bytes to log. |
Definition at line 466 of file log.hpp.
References idfxx::log::buffer_char().
|
inline |
Log a buffer as hexadecimal bytes.
| lvl | The log severity level. |
| buffer | Pointer to the buffer data. |
| length | Number of bytes to log. |
Definition at line 455 of file log.hpp.
References idfxx::log::buffer_hex().
|
inline |
Log a buffer as a formatted hex dump.
| lvl | The log severity level. |
| buffer | Pointer to the buffer data. |
| length | Number of bytes to log. |
Definition at line 477 of file log.hpp.
References idfxx::log::buffer_hex_dump().
|
inline |
Log a message at debug level.
| Args | Format argument types, deduced from the arguments. |
| fmt | A std::format format string, validated at compile time. |
| args | Arguments to format into the message. |
Definition at line 408 of file log.hpp.
References idfxx::log::debug.
|
inline |
Log a pre-formatted message at debug level.
| msg | The message string to log. |
Definition at line 417 of file log.hpp.
References idfxx::log::debug.
|
inline |
Log a message at error level.
| Args | Format argument types, deduced from the arguments. |
| fmt | A std::format format string, validated at compile time. |
| args | Arguments to format into the message. |
Definition at line 351 of file log.hpp.
References idfxx::log::error.
|
inline |
Log a pre-formatted message at error level.
| msg | The message string to log. |
Definition at line 360 of file log.hpp.
References idfxx::log::error.
|
inline |
Log a message at info level.
| Args | Format argument types, deduced from the arguments. |
| fmt | A std::format format string, validated at compile time. |
| args | Arguments to format into the message. |
Definition at line 389 of file log.hpp.
References idfxx::log::info.
|
inline |
Log a pre-formatted message at info level.
| msg | The message string to log. |
Definition at line 398 of file log.hpp.
References idfxx::log::info.
|
inline |
Log a message at the specified level.
| Args | Format argument types, deduced from the arguments. |
| lvl | The log severity level. |
| fmt | A std::format format string, validated at compile time. |
| args | Arguments to format into the message. |
Definition at line 331 of file log.hpp.
References idfxx::log::log().
|
inline |
Log a pre-formatted message at the specified level.
| lvl | The log severity level. |
| msg | The message string to log. |
Definition at line 341 of file log.hpp.
References idfxx::log::log().
| void idfxx::log::logger::set_level | ( | level | lvl | ) | const |
Set the runtime log level for this logger's tag.
Messages with a severity below the configured level are suppressed at runtime.
| lvl | The minimum severity level to output. |
|
inlineconstexprnoexcept |
|
inline |
Log a message at verbose level.
| Args | Format argument types, deduced from the arguments. |
| fmt | A std::format format string, validated at compile time. |
| args | Arguments to format into the message. |
Definition at line 427 of file log.hpp.
References idfxx::log::verbose.
|
inline |
Log a pre-formatted message at verbose level.
| msg | The message string to log. |
Definition at line 436 of file log.hpp.
References idfxx::log::verbose.
|
inline |
Log a message at warning level.
| Args | Format argument types, deduced from the arguments. |
| fmt | A std::format format string, validated at compile time. |
| args | Arguments to format into the message. |
Definition at line 370 of file log.hpp.
References idfxx::log::warn.
|
inline |
Log a pre-formatted message at warning level.
| msg | The message string to log. |
Definition at line 379 of file log.hpp.
References idfxx::log::warn.