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
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
* @code
12
* // 1. Define output sink
13
* struct UartOut {
14
* static void write(const char* s) { uart_puts(s); }
15
* };
16
*
17
* // 2. Define timestamp provider
18
* struct SysTime {
19
* static uint32_t now() { return millis(); }
20
* };
21
*
22
* // 3. Configure before including macros
23
* #define SBL_LOG_OUTPUT UartOut
24
* #define SBL_LOG_TIMESTAMP SysTime
25
* #define SBL_LOG_LEVEL SBL_LOG_LEVEL_DEBUG
26
* #include <sbl/common/log/macros.hpp>
27
*
28
* // 4. Use
29
* SBL_LOG_INFO("Hello %s", "world");
30
* // Output: I 12345 main.cpp:42| Hello world
31
* @endcode
32
*/
33
34
#ifndef SBL_COMMON_LOG_LOG_HPP_
35
#define SBL_COMMON_LOG_LOG_HPP_
36
37
#include <
sbl/common/log/format.hpp
>
38
#include <
sbl/common/log/logger.hpp
>
39
// Note: macros.hpp requires configuration, include separately
40
41
#endif
// SBL_COMMON_LOG_LOG_HPP_
format.hpp
Minimal safe string formatting for embedded systems.
logger.hpp
Logger class with timestamp provider and output sink.
src
sbl
common
log
log.hpp
Generated by
1.9.8