blob: 28dbf148597e298dcb1b4c48f0c59211e93c16b0 (
plain)
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
|
#ifndef COMET_LOG_H
#define COMET_LOG_H
#include <stdio.h>
#define DEBUG_FORMAT(format, ...) \
"[%s] \x1b[1mdebug\x1b[0m: " format, __func__, ## __VA_ARGS__
#define INFO_FORMAT(format, ...) \
"[%s] \x1b[1;96minfo\x1b[0m: " format, __func__, ## __VA_ARGS__
#define WARNING_FORMAT(format, ...) \
"[%s] \x1b[1;33mwarning\x1b[0m: " format, __func__, ## __VA_ARGS__
#define ERROR_FORMAT(format, ...) \
"[%s] \x1b[1;31merror\x1b[0m: " format, __func__, ## __VA_ARGS__
#define log_debug(...) g_debug(DEBUG_FORMAT(__VA_ARGS__))
#define log_info(...) g_info(INFO_FORMAT(__VA_ARGS__))
#define log_warning(...) g_warning(WARNING_FORMAT(__VA_ARGS__))
#define log_error(...) g_error(ERROR_FORMAT(__VA_ARGS__))
void log_init(GLogLevelFlags level);
#endif
// vim: ts=4 sw=4 et
|