summaryrefslogtreecommitdiffstats
path: root/include/log.h
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-05-02 13:50:08 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-05-02 13:50:08 -0400
commit93743e0d5f223d701ee934e61bfc7c2db4d24344 (patch)
treebb62675e504f73e2a1c1f71727256ae5f8e5bfa1 /include/log.h
parentMerge pull request #634 from 1ace/fix/log-double-close (diff)
parentcommon: refactor sway_log() (diff)
downloadsway-93743e0d5f223d701ee934e61bfc7c2db4d24344.tar.gz
sway-93743e0d5f223d701ee934e61bfc7c2db4d24344.tar.zst
sway-93743e0d5f223d701ee934e61bfc7c2db4d24344.zip
Merge pull request #632 from 1ace/refactor/log
Refactor preprocessor logic out of _sway_log()
Diffstat (limited to 'include/log.h')
-rw-r--r--include/log.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/log.h b/include/log.h
index 268783f4..efacf90f 100644
--- a/include/log.h
+++ b/include/log.h
@@ -22,14 +22,14 @@ bool _sway_assert(bool condition, const char* format, ...) __attribute__((format
22#define sway_assert(COND, FMT, ...) \ 22#define sway_assert(COND, FMT, ...) \
23 _sway_assert(COND, "%s:" FMT, __PRETTY_FUNCTION__, ##__VA_ARGS__) 23 _sway_assert(COND, "%s:" FMT, __PRETTY_FUNCTION__, ##__VA_ARGS__)
24 24
25#ifndef NDEBUG
26void _sway_log(const char *filename, int line, log_importance_t verbosity, const char* format, ...) __attribute__((format(printf,4,5))); 25void _sway_log(const char *filename, int line, log_importance_t verbosity, const char* format, ...) __attribute__((format(printf,4,5)));
26
27#ifndef NDEBUG
27#define sway_log(VERBOSITY, FMT, ...) \ 28#define sway_log(VERBOSITY, FMT, ...) \
28 _sway_log(__FILE__, __LINE__, VERBOSITY, FMT, ##__VA_ARGS__) 29 _sway_log(__FILE__, __LINE__, VERBOSITY, FMT, ##__VA_ARGS__)
29#else 30#else
30void _sway_log(log_importance_t verbosity, const char* format, ...) __attribute__((format(printf,2,3)));
31#define sway_log(VERBOSITY, FMT, ...) \ 31#define sway_log(VERBOSITY, FMT, ...) \
32 _sway_log(VERBOSITY, FMT, ##__VA_ARGS__) 32 _sway_log(NULL, 0, VERBOSITY, FMT, ##__VA_ARGS__)
33#endif 33#endif
34 34
35void error_handler(int sig); 35void error_handler(int sig);