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

An app's logging: the build's default sink and timestamp, then the macros. More...

Detailed Description

An app's logging: the build's default sink and timestamp, then the macros.

Include this in firmware in place of <sbl/common/log/macros.hpp>. Unless the app defines them first:

  • SBL_LOG_OUTPUT is the USB CDC serial port in a build with USB (sbl_setup_usb() defines SBL_HAS_USB), and the debug UART otherwise.
  • SBL_LOG_TIMESTAMP is milliseconds from the system timer.

The choice is made here, above the layers it names, so common/log depends on none of them. Code without hardware (a unit test, a host tool) includes <sbl/common/log/macros.hpp> itself and gets sinks that write nothing unless it defines its own.

#define SBL_LOG_LEVEL SBL_LOG_LEVEL_DEBUG // optional
#include <sbl/log.hpp>
SBL_LOG_INFO("tune %d", 440);
An app's logging: the build's default sink and timestamp, then the macros.

Definition in file log.hpp.

Go to the source code of this file.

Macros

#define SBL_LOG_OUTPUT   sbl::uart::LogOutput
 
#define SBL_LOG_TIMESTAMP   sbl::system::timer::MillisTimestamp
 

Macro Definition Documentation

◆ SBL_LOG_OUTPUT

#define SBL_LOG_OUTPUT   sbl::uart::LogOutput

Definition at line 39 of file log.hpp.

◆ SBL_LOG_TIMESTAMP

#define SBL_LOG_TIMESTAMP   sbl::system::timer::MillisTimestamp

Definition at line 44 of file log.hpp.