|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Lightweight logging system. More...
Namespaces | |
| namespace | detail |
Classes | |
| class | Logger |
| Logger class with compile-time level filtering. More... | |
| struct | NullOutput |
| Null output sink (discards all output) More... | |
| struct | NullTimestamp |
| Default timestamp provider (returns 0) More... | |
| struct | SdLogConfig |
| class | SdLogOutput |
| struct | TeeOutput |
Enumerations | |
| enum class | Level : uint8_t { Off = 0 , Error = 1 , Warn = 2 , Info = 3 , Debug = 4 , Trace = 5 } |
| Log severity levels. More... | |
Functions | |
| int | format_banner (char *buf, size_t size, const char *app_name, uint32_t sample_rate, uint16_t block_size) |
| Format a boot banner into a buffer. | |
| int | vformat (char *buf, size_t size, const char *fmt, va_list args) |
| Format a string into a buffer (vsnprintf-style) | |
| int | format (char *buf, size_t size, const char *fmt,...) |
| Format a string into a buffer (snprintf-style) | |
| constexpr char | level_char (Level level) |
| Convert level to single character. | |
| constexpr const char * | basename (const char *path) |
| Extract filename from path (compile-time safe) | |
Lightweight logging system.
Zero-overhead when disabled. Compile-time level filtering via macros. Configure output sink, timestamp provider, and log level before including <sbl/log/macros.hpp>.
|
strong |
Log severity levels.
| Enumerator | |
|---|---|
| Off | |
| Error | |
| Warn | |
| Info | |
| Debug | |
| Trace | |
Definition at line 26 of file logger.hpp.
|
constexpr |
Extract filename from path (compile-time safe)
Returns pointer to last path component (e.g., "main.cpp" from "/foo/bar/main.cpp")
Definition at line 70 of file logger.hpp.
Referenced by sbl::log::Logger< Output, TimestampProvider, MinLevel >::log().
|
inline |
Format a string into a buffer (snprintf-style)
| buf | Output buffer |
| size | Buffer size |
| fmt | Format string |
| ... | Arguments |
Definition at line 265 of file format.hpp.
References vformat().
Referenced by sbl::profiling::format_report(), sbl::profiling::format_tagged_histogram(), sbl::profiling::format_tagged_report(), sbl::log::Logger< Output, TimestampProvider, MinLevel >::log(), sbl::log::Logger< Output, TimestampProvider, MinLevel >::log_simple(), sbl::fault::on_hard_fault(), and sbl::fault::panic().
|
inline |
Format a boot banner into a buffer.
| buf | Output buffer |
| size | Buffer size (recommend >= 384) |
| app_name | Application name (e.g., "hello-instrument") |
| sample_rate | Audio sample rate in Hz (e.g., 48000) |
| block_size | Audio block size in frames (e.g., 48) |
Definition at line 94 of file banner.hpp.
References sbl::log::detail::banner_append(), and sbl::log::detail::banner_append_uint().
|
constexpr |
Convert level to single character.
Definition at line 38 of file logger.hpp.
References Debug, Error, Info, Trace, and Warn.
Referenced by sbl::log::Logger< Output, TimestampProvider, MinLevel >::log(), and sbl::log::Logger< Output, TimestampProvider, MinLevel >::log_simple().
|
inline |
Format a string into a buffer (vsnprintf-style)
| buf | Output buffer |
| size | Buffer size |
| fmt | Format string |
| args | Variadic argument list |
Definition at line 35 of file format.hpp.
Referenced by format(), sbl::log::Logger< Output, TimestampProvider, MinLevel >::log(), and sbl::log::Logger< Output, TimestampProvider, MinLevel >::log_simple().