-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlog.h
41 lines (33 loc) · 763 Bytes
/
log.h
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
#ifndef LOG_H
#define LOG_H
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef DEBUG
# define debug logit
#else
# define debug fake_logit
#endif
#ifndef NDEBUG
# define logit(format, ...) \
internal_logit (__FILE__, __LINE__, __FUNCTION__, format, \
## __VA_ARGS__)
#else
# define logit fake_logit
#endif
#ifdef HAVE__ATTRIBUTE__
void internal_logit (const char *file, const int line, const char *function,
const char *format, ...)
__attribute__ ((format (printf, 4, 5)));
#else
void internal_logit (const char *file, const int line, const char *function,
const char *format, ...);
#endif
void fake_logit (const char *format, ...);
void log_init_stream (FILE *f, const char *fn);
void log_close ();
#ifdef __cplusplus
}
#endif
#endif