aboutsummaryrefslogtreecommitdiffstats
path: root/include/log.h
diff options
context:
space:
mode:
authorLibravatar minus <minus@mnus.de>2015-08-18 23:38:34 +0200
committerLibravatar minus <minus@mnus.de>2015-08-18 23:38:34 +0200
commitfaccaf6112d923533512e1dd868ec4bf0d30e1b5 (patch)
tree2bbbffaadd3f390e0228e0d687f0a3b6c58bd3ba /include/log.h
parentImprove README (more) (diff)
downloadsway-faccaf6112d923533512e1dd868ec4bf0d30e1b5.tar.gz
sway-faccaf6112d923533512e1dd868ec4bf0d30e1b5.tar.zst
sway-faccaf6112d923533512e1dd868ec4bf0d30e1b5.zip
added sway_assert function
returns false on a failed assertion in release mode and raises SIGABRT in debug mode
Diffstat (limited to 'include/log.h')
-rw-r--r--include/log.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/log.h b/include/log.h
index d35b2a54..44f84940 100644
--- a/include/log.h
+++ b/include/log.h
@@ -1,5 +1,6 @@
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 4
4typedef enum { 5typedef enum {
5 L_SILENT = 0, 6 L_SILENT = 0,
@@ -10,7 +11,8 @@ typedef enum {
10 11
11void init_log(int verbosity); 12void init_log(int verbosity);
12void sway_log_colors(int mode); 13void sway_log_colors(int mode);
13void sway_log(int verbosity, char* format, ...) __attribute__((format(printf,2,3))); 14void sway_log(int verbosity, const char* format, ...) __attribute__((format(printf,2,3)));
14void sway_abort(char* format, ...)__attribute__((format(printf,1,2))); 15void sway_abort(const char* format, ...) __attribute__((format(printf,1,2)));
16bool sway_assert(bool condition, const char* format, ...) __attribute__((format(printf,2,3)));
15 17
16#endif 18#endif