Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_log.h
1 #ifndef _BC_LOG_H
2 #define _BC_LOG_H
3 
4 #include <bc_common.h>
5 #include <bc_uart.h>
6 
10 
11 #ifndef BC_LOG_UART
12 #define BC_LOG_UART BC_UART_UART2
13 #endif
14 
15 #define BC_LOG_DUMP_WIDTH 8
16 
18 
19 typedef enum
20 {
23 
26 
29 
32 
35 
38 
40 
42 
43 typedef enum
44 {
47 
50 
53 
55 
56 #ifndef RELEASE
57 
61 
62 void bc_log_init(bc_log_level_t level, bc_log_timestamp_t timestamp);
63 
69 
70 void bc_log_dump(const void *buffer, size_t length, const char *format, ...);
71 
75 
76 void bc_log_debug(const char *format, ...);
77 
81 
82 void bc_log_info(const char *format, ...);
83 
87 
88 void bc_log_warning(const char *format, ...);
89 
93 
94 void bc_log_error(const char *format, ...);
95 
96 #else
97 
98 #define bc_log_init(...)
99 #define bc_log_dump(...)
100 #define bc_log_debug(...)
101 #define bc_log_info(...)
102 #define bc_log_warning(...)
103 #define bc_log_error(...)
104 
105 #endif
106 
108 
109 #endif // _BC_LOG_H
Log level INFO.
Definition: bc_log.h:28
void bc_log_warning(const char *format,...)
Log WARNING message (annotated in log as <W>)
Definition: bc_log.c:162
Log level ERROR.
Definition: bc_log.h:34
Log level DEBUG.
Definition: bc_log.h:25
Logging DUMP.
Definition: bc_log.h:22
void bc_log_info(const char *format,...)
Log INFO message (annotated in log as )
Definition: bc_log.c:153
Logging disabled.
Definition: bc_log.h:37
Log level WARNING.
Definition: bc_log.h:31
void bc_log_init(bc_log_level_t level, bc_log_timestamp_t timestamp)
Initialize logging facility.
Definition: bc_log.c:23
bc_log_level_t
Log level.
Definition: bc_log.h:19
Timestamp logging disabled.
Definition: bc_log.h:46
bc_log_timestamp_t
Log timestamp.
Definition: bc_log.h:43
void bc_log_dump(const void *buffer, size_t length, const char *format,...)
Log DUMP message (annotated in log as <X>)
Definition: bc_log.c:41
void bc_log_error(const char *format,...)
Log ERROR message (annotated in log as <E>)
Definition: bc_log.c:171
Timestamp logging enabled (absolute time format)
Definition: bc_log.h:49
Timestamp logging enabled (relative time format)
Definition: bc_log.h:52
void bc_log_debug(const char *format,...)
Log DEBUG message (annotated in log as <D>)
Definition: bc_log.c:144