diff options
Diffstat (limited to 'include/log.h')
-rw-r--r-- | include/log.h | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/include/log.h b/include/log.h index a1e33fa2..646776f5 100644 --- a/include/log.h +++ b/include/log.h | |||
@@ -1,22 +1,7 @@ | |||
1 | #ifndef _SWAY_LOG_H | 1 | #ifndef _SWAY_LOG_H |
2 | #define _SWAY_LOG_H | 2 | #define _SWAY_LOG_H |
3 | #include <stdbool.h> | 3 | #include <stdbool.h> |
4 | 4 | #include <wlr/util/log.h> | |
5 | typedef enum { | ||
6 | L_SILENT = 0, | ||
7 | L_ERROR = 1, | ||
8 | L_INFO = 2, | ||
9 | L_DEBUG = 3, | ||
10 | } log_importance_t; | ||
11 | |||
12 | void init_log(log_importance_t verbosity); | ||
13 | void set_log_level(log_importance_t verbosity); | ||
14 | log_importance_t get_log_level(void); | ||
15 | void reset_log_level(void); | ||
16 | // returns whether debug logging is on after switching. | ||
17 | bool toggle_debug_logging(void); | ||
18 | void sway_log_colors(int mode); | ||
19 | void sway_log_errno(log_importance_t verbosity, char* format, ...) __attribute__((format(printf,2,3))); | ||
20 | 5 | ||
21 | void _sway_abort(const char *filename, int line, const char* format, ...) __attribute__((format(printf,3,4))); | 6 | void _sway_abort(const char *filename, int line, const char* format, ...) __attribute__((format(printf,3,4))); |
22 | #define sway_abort(FMT, ...) \ | 7 | #define sway_abort(FMT, ...) \ |
@@ -26,14 +11,6 @@ bool _sway_assert(bool condition, const char *filename, int line, const char* fo | |||
26 | #define sway_assert(COND, FMT, ...) \ | 11 | #define sway_assert(COND, FMT, ...) \ |
27 | _sway_assert(COND, __FILE__, __LINE__, "%s:" FMT, __PRETTY_FUNCTION__, ##__VA_ARGS__) | 12 | _sway_assert(COND, __FILE__, __LINE__, "%s:" FMT, __PRETTY_FUNCTION__, ##__VA_ARGS__) |
28 | 13 | ||
29 | void _sway_log(const char *filename, int line, log_importance_t verbosity, const char* format, ...) __attribute__((format(printf,4,5))); | ||
30 | |||
31 | #define sway_log(VERBOSITY, FMT, ...) \ | ||
32 | _sway_log(__FILE__, __LINE__, VERBOSITY, FMT, ##__VA_ARGS__) | ||
33 | |||
34 | #define sway_vlog(VERBOSITY, FMT, VA_ARGS) \ | ||
35 | _sway_vlog(__FILE__, __LINE__, VERBOSITY, FMT, VA_ARGS) | ||
36 | |||
37 | void error_handler(int sig); | 14 | void error_handler(int sig); |
38 | 15 | ||
39 | #endif | 16 | #endif |