Sound Byte Libs 1ee2ca6
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
sbl::log::Logger< Output, TimestampProvider, MinLevel > Class Template Reference

Logger class with compile-time level filtering. More...

#include <logger.hpp>

Collaboration diagram for sbl::log::Logger< Output, TimestampProvider, MinLevel >:

Static Public Member Functions

static void log (Level level, const char *file, int line, const char *fmt,...)
 Log a message with file/line location.
 
static void log_simple (Level level, const char *fmt,...)
 Log without location info (simpler format)
 

Static Public Attributes

static constexpr size_t BUFFER_SIZE = 256
 

Detailed Description

template<typename Output, typename TimestampProvider = NullTimestamp, Level MinLevel = Level::Info>
class sbl::log::Logger< Output, TimestampProvider, MinLevel >

Logger class with compile-time level filtering.

Template Parameters
OutputSink type with static write(const char*) method
TimestampProviderType with static uint32_t now() method
MinLevelMinimum level to compile (lower levels are eliminated)

Definition at line 89 of file logger.hpp.

Member Function Documentation

◆ log()

template<typename Output , typename TimestampProvider = NullTimestamp, Level MinLevel = Level::Info>
static void sbl::log::Logger< Output, TimestampProvider, MinLevel >::log ( Level  level,
const char *  file,
int  line,
const char *  fmt,
  ... 
)
inlinestatic

Log a message with file/line location.

Parameters
levelLog severity level
fileSource file name
lineSource line number
fmtPrintf-style format string
...Format arguments

Definition at line 102 of file logger.hpp.

References sbl::log::basename(), sbl::log::Logger< Output, TimestampProvider, MinLevel >::BUFFER_SIZE, sbl::log::format(), sbl::log::level_char(), and sbl::log::vformat().

Here is the call graph for this function:

◆ log_simple()

template<typename Output , typename TimestampProvider = NullTimestamp, Level MinLevel = Level::Info>
static void sbl::log::Logger< Output, TimestampProvider, MinLevel >::log_simple ( Level  level,
const char *  fmt,
  ... 
)
inlinestatic

Log without location info (simpler format)

Format: I 12345| Message

Definition at line 143 of file logger.hpp.

References sbl::log::Logger< Output, TimestampProvider, MinLevel >::BUFFER_SIZE, sbl::log::format(), sbl::log::level_char(), and sbl::log::vformat().

Here is the call graph for this function:

Member Data Documentation

◆ BUFFER_SIZE

template<typename Output , typename TimestampProvider = NullTimestamp, Level MinLevel = Level::Info>
constexpr size_t sbl::log::Logger< Output, TimestampProvider, MinLevel >::BUFFER_SIZE = 256
staticconstexpr

The documentation for this class was generated from the following file: