Sound Byte Libs
1ee2ca6
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
src
sbl
log
log.hpp
Go to the documentation of this file.
1
/**
2
* @file log.hpp
3
* @brief Logging system umbrella header
4
*
5
* Includes all logging components:
6
* - format.hpp: Safe string formatting
7
* - logger.hpp: Logger class with timestamp provider
8
* - macros.hpp: Zero-overhead logging macros
9
*
10
* Quick start:
11
* // 1. Define output sink
12
* struct UartOut {
13
* static void write(const char* s) { uart_puts(s); }
14
* };
15
*
16
* // 2. Define timestamp provider
17
* struct SysTime {
18
* static uint32_t now() { return millis(); }
19
* };
20
*
21
* // 3. Configure before including macros
22
* #define SBL_LOG_OUTPUT UartOut
23
* #define SBL_LOG_TIMESTAMP SysTime
24
* #define SBL_LOG_LEVEL SBL_LOG_LEVEL_DEBUG
25
* #include <sbl/log/macros.hpp>
26
*
27
* // 4. Use
28
* SBL_LOG_INFO("Hello %s", "world");
29
* // Output: I 12345 main.cpp:42| Hello world
30
*/
31
32
#ifndef SBL_LOG_LOG_HPP_
33
#define SBL_LOG_LOG_HPP_
34
35
#include <
sbl/log/format.hpp
>
36
#include <
sbl/log/logger.hpp
>
37
// Note: macros.hpp requires configuration, include separately
38
39
#endif
// SBL_LOG_LOG_HPP_
format.hpp
Minimal safe string formatting for embedded systems.
logger.hpp
Logger class with timestamp provider and output sink.
Generated by
1.9.8