-
Notifications
You must be signed in to change notification settings - Fork 59
/
log.h
49 lines (42 loc) · 1019 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
42
43
44
45
46
47
48
49
#ifndef LOG_H
#define LOG_H
/**
* \brief Log types
*/
typedef enum {
fatal = 1 << 0,
error = 1 << 1,
warning = 1 << 2,
info = 1 << 3,
debug = 1 << 4,
link_lock_debug = 1 << 5,
network_lock_debug = 1 << 6,
cache_lock_debug = 1 << 7,
memcache_debug = 1 << 8,
libcurl_debug = 1 << 9,
} LogType;
/**
* \brief The default log level
*/
#define DEFAULT_LOG_LEVEL fatal | error | warning | info
/**
* \brief Get the log level from the environment.
*/
int log_level_init(void);
/**
* \brief Log printf
* \details This is for printing nice log messages
*/
void log_printf(LogType type, const char *file, const char *func, int line,
const char *format, ...);
/**
* \brief Log type printf
* \details This macro automatically prints out the filename and line number
*/
#define lprintf(type, ...) \
log_printf(type, __FILE__, __func__, __LINE__, __VA_ARGS__)
/**
* \brief Print the version information for HTTPDirFS
*/
void print_version(void);
#endif