-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.h
37 lines (30 loc) · 955 Bytes
/
logger.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
#ifndef LOGGER_H_INCLUDED
#define LOGGER_H_INCLUDED 1
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
enum LOGGER_LEVEL {
LOGGER_LEVEL_DEBUG,
LOGGER_LEVEL_INFO,
LOGGER_LEVEL_WARN,
LOGGER_LEVEL_ERROR,
LOGGER_LEVEL_FATAL,
NUM_LOGGER_LEVELS
};
void logger_vlog(const enum LOGGER_LEVEL level, const char *message, va_list args);
void logger_log(const enum LOGGER_LEVEL level, const char *message, ...);
void logger_debug(const char *message, ...);
void logger_info(const char *message, ...);
void logger_warn(const char *message, ...);
void logger_error(const char *message, ...);
void logger_fatal(const char *message, ...);
#define LOG_DEBUG(...) logger_debug(__VA_ARGS__)
#define LOG_INFO(...) logger_(__VA_ARGS__)
#define LOG_WARN(...) logger_warn(__VA_ARGS__)
#define LOG_ERROR(...) logger_error(__VA_ARGS__)
#define LOG_FATAL(...) logger_fatal(__VA_ARGS__)
#ifdef __cplusplus
}
#endif
#endif // !defined(LOGGER_H_INCLUDED)