|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Logging. More...
Logging.
Classes | |
| class | Logger |
| Logger class with compile-time level filtering. More... | |
| struct | NullOutput |
| struct | NullTimestamp |
| struct | SdLogConfig |
| class | SdLogOutput |
| class | TaggedLine |
One #TAG key=value ... line in a fixed buffer. More... | |
| class | TaggedValues |
| Named values written under one tag, on change, at a capped rate. More... | |
| 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) | |
Variables | |
| constexpr const char * | LOGO_ART |
| constexpr const char * | LOGO_BRAND = "Sound Byte " SBL_BANNER_BRAND " " |
| template<typename T > | |
| constexpr bool | is_sink_v = detail::is_sink<T>::value |
| template<typename T > | |
| constexpr bool | is_timestamp_v = detail::is_timestamp<T>::value |
| constexpr uint8_t | TAGGED_MAX_DECIMALS = 6 |
| constexpr float | TAGGED_MAX_MAGNITUDE = 4.0e9f |
|
strong |
Log severity levels.
Definition at line 27 of file logger.hpp.
|
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 99 of file banner.hpp.
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().
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::system::profiling::format_tagged_histogram(), sbl::log::Logger< Output, TimestampProvider, MinLevel >::log(), sbl::log::Logger< Output, TimestampProvider, MinLevel >::log_simple(), sbl::system::fault::on_hard_fault(), and sbl::system::fault::panic().
Convert level to single character.
Definition at line 39 of file logger.hpp.
Referenced by sbl::log::Logger< Output, TimestampProvider, MinLevel >::log(), and sbl::log::Logger< Output, TimestampProvider, MinLevel >::log_simple().
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 55 of file logger.hpp.
Referenced by sbl::log::Logger< Output, TimestampProvider, MinLevel >::log().
|
inlineconstexpr |
True for a type that meets the sink contract.
Definition at line 55 of file sink.hpp.
Referenced by sbl::log::SdLogOutput::close(), sbl::log::TaggedLine< SIZE >::field(), sbl::log::TaggedLine< SIZE >::field(), sbl::log::TaggedLine< SIZE >::field(), sbl::log::SdLogOutput::flush(), sbl::log::Logger< Output, TimestampProvider, MinLevel >::log(), sbl::log::Logger< Output, TimestampProvider, MinLevel >::log_simple(), sbl::log::TaggedValues< COUNT, LINE >::name(), sbl::log::TaggedValues< COUNT, LINE >::poll(), sbl::log::TaggedLine< SIZE >::reset(), sbl::log::TaggedValues< COUNT, LINE >::set(), sbl::log::TaggedValues< COUNT, LINE >::TaggedValues(), and sbl::log::SdLogOutput::write().
Decimal places TaggedLine writes a float with at most.
Definition at line 48 of file tagged.hpp.
Referenced by sbl::log::TaggedLine< SIZE >::field().
Largest magnitude format() writes a float at (its integer part is a uint32_t).
Definition at line 51 of file tagged.hpp.
Referenced by sbl::log::TaggedLine< SIZE >::field().