Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
logger.hpp File Reference

Logger class with timestamp provider and output sink. More...

Detailed Description

Logger class with timestamp provider and output sink.

Output format: I 12345 main.cpp:42| Message

The Logger class is templated on:

  • Output: Sink type with static write(const char*) method
  • TimestampProvider: Type with static uint32_t now() method

Use the macros in macros.hpp for automatic file/line capture.

Definition in file logger.hpp.

#include <cstdint>
#include <cstddef>
#include <sbl/common/log/format.hpp>

Go to the source code of this file.

Classes

struct  sbl::log::NullTimestamp
 Default timestamp provider (returns 0) More...
 
struct  sbl::log::NullOutput
 Null output sink (discards all output) More...
 
class  sbl::log::Logger< Output, TimestampProvider, MinLevel >
 Logger class with compile-time level filtering. More...
 

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::log
 Logging.
 

Enumerations

enum class  sbl::log::Level : uint8_t {
  sbl::log::Off = 0 , sbl::log::Error = 1 , sbl::log::Warn = 2 , sbl::log::Info = 3 ,
  sbl::log::Debug = 4 , sbl::log::Trace = 5
}
 Log severity levels. More...
 

Functions

constexpr char sbl::log::level_char (Level level)
 Convert level to single character.
 
constexpr const char * sbl::log::basename (const char *path)
 Extract filename from path (compile-time safe)