Add a FATAL ERROR log level

For errors that cause compton to quit

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2018-12-20 01:58:23 +00:00
parent 537831abfc
commit fc57c7b55b
2 changed files with 7 additions and 3 deletions

View File

@@ -8,12 +8,13 @@
#include "compiler.h"
enum log_level {
LOG_LEVEL_INVALID = -1,
LOG_LEVEL_TRACE = 0,
LOG_LEVEL_DEBUG,
LOG_LEVEL_INFO,
LOG_LEVEL_WARN,
LOG_LEVEL_ERROR,
LOG_LEVEL_INVALID
LOG_LEVEL_FATAL,
};
#define LOG(level, x, ...) \
@@ -23,6 +24,7 @@ enum log_level {
#define log_info(x, ...) LOG(INFO, x, ##__VA_ARGS__)
#define log_warn(x, ...) LOG(WARN, x, ##__VA_ARGS__)
#define log_error(x, ...) LOG(ERROR, x, ##__VA_ARGS__)
#define log_fatal(x, ...) LOG(FATAL, x, ##__VA_ARGS__)
/// Print out an error message.
#define printf_err(format, ...) log_error(format, ##__VA_ARGS__)