7 #ifndef UBICLIB_LOGM_H_
8 #define UBICLIB_LOGM_H_
23 #include <ubinos_config.h>
28 #define LOGM_CATEGORY__NONE 0
31 #define LOGM_CATEGORY__UBINOS 1
33 #define LOGM_CATEGORY__BSP 2
35 #define LOGM_CATEGORY__UBIK 3
37 #define LOGM_CATEGORY__TASK 4
39 #define LOGM_CATEGORY__SEM 5
41 #define LOGM_CATEGORY__MSGQ 6
43 #define LOGM_CATEGORY__CONDV 7
45 #define LOGM_CATEGORY__SIGNAL 8
47 #define LOGM_CATEGORY__STIMER 9
50 #define LOGM_CATEGORY__UBICLIB 10
52 #define LOGM_CATEGORY__HEAP 11
55 #define LOGM_CATEGORY__UBIDRV 12
57 #define LOGM_CATEGORY__NVMEM 13
60 #define LOGM_CATEGORY__RESOLVED04 14
61 #define LOGM_CATEGORY__RESOLVED05 15
62 #define LOGM_CATEGORY__RESOLVED06 16
63 #define LOGM_CATEGORY__RESOLVED07 17
64 #define LOGM_CATEGORY__RESOLVED08 18
65 #define LOGM_CATEGORY__RESOLVED09 19
68 #define LOGM_CATEGORY__SYS00 20
70 #define LOGM_CATEGORY__SYS01 21
72 #define LOGM_CATEGORY__SYS02 22
74 #define LOGM_CATEGORY__SYS03 23
76 #define LOGM_CATEGORY__SYS04 24
78 #define LOGM_CATEGORY__SYS05 25
80 #define LOGM_CATEGORY__SYS06 26
82 #define LOGM_CATEGORY__SYS07 27
84 #define LOGM_CATEGORY__SYS08 28
86 #define LOGM_CATEGORY__SYS09 29
89 #define LOGM_CATEGORY__USER00 30
91 #define LOGM_CATEGORY__USER01 31
93 #define LOGM_CATEGORY__USER02 32
95 #define LOGM_CATEGORY__USER03 33
97 #define LOGM_CATEGORY__USER04 34
99 #define LOGM_CATEGORY__USER05 35
101 #define LOGM_CATEGORY__USER06 36
103 #define LOGM_CATEGORY__USER07 37
105 #define LOGM_CATEGORY__USER08 38
107 #define LOGM_CATEGORY__USER09 39
110 #define LOGM_CATEGORY__END 40
114 #define LOGM_LEVEL__SILENT 0
116 #define LOGM_LEVEL__FATAL 1
118 #define LOGM_LEVEL__ERROR 2
120 #define LOGM_LEVEL__WARNING 3
122 #define LOGM_LEVEL__INFO 4
124 #define LOGM_LEVEL__DEBUG 5
126 #define LOGM_LEVEL__VERBOSE 6
128 #define LOGM_LEVEL__END 7
132 #define LOGM_CATEGORY LOGM_CATEGORY__NONE
134 #define LOGM_LEVEL LOGM_LEVEL__WARNING
136 #define LOGM_TAG NULL
140 #define LOGM_TICK_COUNT_LENGTH 10
143 #define LOGM_TAG_LENGTH 20
146 #define LOGM_FUNCTION_NAME_LENGTH 40
149 #define LOGM_LINE_NUMBER_LENGTH 6
152 #if !(UBINOS__UBICLIB__EXCLUDE_LOGM == 1)
200 int logm_println(
int category,
int level,
const char * tag,
const char * func,
int line,
const char * msg);
223 int logm_printfln(
int category,
int level,
const char * tag,
const char * func,
int line,
const char * format, ...);
227 #define logm (msg) logm_println(LOGM_CATEGORY, LOGM_LEVEL, LOGM_TAG, __FUNCTION__, __LINE__, msg)
230 #define logmt(msg) logm_println(LOGM_CATEGORY, LOGM_LEVEL__FATAL, LOGM_TAG, __FUNCTION__, __LINE__, msg)
233 #define logme(msg) logm_println(LOGM_CATEGORY, LOGM_LEVEL__ERROR, LOGM_TAG, __FUNCTION__, __LINE__, msg)
236 #define logmw(msg) logm_println(LOGM_CATEGORY, LOGM_LEVEL__WARNING, LOGM_TAG, __FUNCTION__, __LINE__, msg)
239 #define logmi(msg) logm_println(LOGM_CATEGORY, LOGM_LEVEL__INFO, LOGM_TAG, __FUNCTION__, __LINE__, msg)
242 #define logmd(msg) logm_println(LOGM_CATEGORY, LOGM_LEVEL__DEBUG, LOGM_TAG, __FUNCTION__, __LINE__, msg)
245 #define logmv(msg) logm_println(LOGM_CATEGORY, LOGM_LEVEL__VERBOSE, LOGM_TAG, __FUNCTION__, __LINE__, msg)
249 #define logmf (format, args...) logm_printfln(LOGM_CATEGORY, LOGM_LEVEL, LOGM_TAG, __FUNCTION__, __LINE__, format, ## args)
252 #define logmft(format, args...) logm_printfln(LOGM_CATEGORY, LOGM_LEVEL__FATAL, LOGM_TAG, __FUNCTION__, __LINE__, format, ## args)
255 #define logmfe(format, args...) logm_printfln(LOGM_CATEGORY, LOGM_LEVEL__ERROR, LOGM_TAG, __FUNCTION__, __LINE__, format, ## args)
258 #define logmfw(format, args...) logm_printfln(LOGM_CATEGORY, LOGM_LEVEL__WARNING, LOGM_TAG, __FUNCTION__, __LINE__, format, ## args)
261 #define logmfi(format, args...) logm_printfln(LOGM_CATEGORY, LOGM_LEVEL__INFO, LOGM_TAG, __FUNCTION__, __LINE__, format, ## args)
264 #define logmfd(format, args...) logm_printfln(LOGM_CATEGORY, LOGM_LEVEL__DEBUG, LOGM_TAG, __FUNCTION__, __LINE__, format, ## args)
267 #define logmfv(format, args...) logm_printfln(LOGM_CATEGORY, LOGM_LEVEL__VERBOSE, LOGM_TAG, __FUNCTION__, __LINE__, format, ## args)
285 #define logm_setlevel(category, level) ((void) (LOGM_LEVEL__SILENT))
297 #define logm_getlevel(category) (LOGM_LEVEL__SILENT)
323 #define logmf (format, args...)
326 #define logmft(format, args...)
329 #define logmfe(format, args...)
332 #define logmfw(format, args...)
335 #define logmfi(format, args...)
338 #define logmfd(format, args...)
341 #define logmfv(format, args...)
int logm_setlevel(int category, int level)
int logm_println(int category, int level, const char *tag, const char *func, int line, const char *msg)
int logm_printfln(int category, int level, const char *tag, const char *func, int line, const char *format,...)
int logm_getlevel(int category)