aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/log.c4
-rw-r--r--include/log.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/common/log.c b/common/log.c
index 23b756eb..8e5b71f9 100644
--- a/common/log.c
+++ b/common/log.c
@@ -142,14 +142,14 @@ void sway_log_errno(log_importance_t verbosity, char* format, ...) {
142 } 142 }
143} 143}
144 144
145bool _sway_assert(bool condition, const char* format, ...) { 145bool _sway_assert(bool condition, const char *filename, int line, const char* format, ...) {
146 if (condition) { 146 if (condition) {
147 return true; 147 return true;
148 } 148 }
149 149
150 va_list args; 150 va_list args;
151 va_start(args, format); 151 va_start(args, format);
152 sway_vlog(L_ERROR, format, args); 152 _sway_vlog(filename, line, L_ERROR, format, args);
153 va_end(args); 153 va_end(args);
154 154
155#ifndef NDEBUG 155#ifndef NDEBUG
diff --git a/include/log.h b/include/log.h
index 60b3763b..32981b62 100644
--- a/include/log.h
+++ b/include/log.h
@@ -19,9 +19,9 @@ void sway_log_colors(int mode);
19void sway_log_errno(log_importance_t verbosity, char* format, ...) __attribute__((format(printf,2,3))); 19void sway_log_errno(log_importance_t verbosity, char* format, ...) __attribute__((format(printf,2,3)));
20void sway_abort(const char* format, ...) __attribute__((format(printf,1,2))); 20void sway_abort(const char* format, ...) __attribute__((format(printf,1,2)));
21 21
22bool _sway_assert(bool condition, const char* format, ...) __attribute__((format(printf,2,3))); 22bool _sway_assert(bool condition, const char *filename, int line, const char* format, ...) __attribute__((format(printf,4,5)));
23#define sway_assert(COND, FMT, ...) \ 23#define sway_assert(COND, FMT, ...) \
24 _sway_assert(COND, "%s:" FMT, __PRETTY_FUNCTION__, ##__VA_ARGS__) 24 _sway_assert(COND, __FILE__, __LINE__, "%s:" FMT, __PRETTY_FUNCTION__, ##__VA_ARGS__)
25 25
26void _sway_log(const char *filename, int line, log_importance_t verbosity, const char* format, ...) __attribute__((format(printf,4,5))); 26void _sway_log(const char *filename, int line, log_importance_t verbosity, const char* format, ...) __attribute__((format(printf,4,5)));
27 27