1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#define trace(level, ...) tracef(__FILE__, __func__, __LINE__, level, __VA_ARGS__)
#define debug(...) tracef(__FILE__, __func__, __LINE__, TraceLevel_DEBUG, __VA_ARGS__)
#define info(...) tracef(__FILE__, __func__, __LINE__, TraceLevel_INFO, __VA_ARGS__)
#define warning(...) tracef(__FILE__, __func__, __LINE__, TraceLevel_WARNING, __VA_ARGS__)
#define error(...) tracef(__FILE__, __func__, __LINE__, TraceLevel_ERROR, __VA_ARGS__)
enum TraceLevel {
TraceLevel_NONE = 1,
TraceLevel_ERROR = 2,
TraceLevel_WARNING = 3,
TraceLevel_INFO = 4,
TraceLevel_DEBUG = 5,
};
void
vftracef(
const char *const file,
const char *const function,
const int lineno,
FILE *restrict stream,
const enum TraceLevel level,
const char *restrict format,
va_list args
);
void
ftracef(
const char *const file,
const char *const function,
const int lineno,
FILE *restrict stream,
const enum TraceLevel level,
const char *restrict format,
...
);
void
tracef(
const char *const file,
const char *const function,
const int lineno,
const enum TraceLevel level,
const char *restrict format,
...
);
void
trace_set_stream(FILE *stream);
void
trace_set_level(const enum TraceLevel level);
|