diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-04-20 13:00:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-20 13:00:56 -0400 |
commit | d2de52209e2391fce8b9e146ab32b16302756e10 (patch) | |
tree | 6f09e8f2374eada5b031c3c1957caafafdfb0250 /common | |
parent | 382b67810046bc14518451a9ed1341984839e294 (diff) | |
parent | 39a65a6181972d4d5d1e7bd08550727936ff28f7 (diff) |
Merge pull request #1184 from JerziKaminsky/logging2
More Logging Fixes
Diffstat (limited to 'common')
-rw-r--r-- | common/log.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/common/log.c b/common/log.c index 8e5b71f9..61937495 100644 --- a/common/log.c +++ b/common/log.c @@ -53,16 +53,6 @@ void sway_log_colors(int mode) { colored = (mode == 1) ? 1 : 0; } -void sway_abort(const char *format, ...) { - fprintf(stderr, "ERROR: "); - va_list args; - va_start(args, format); - vfprintf(stderr, format, args); - va_end(args); - fprintf(stderr, "\n"); - sway_terminate(EXIT_FAILURE); -} - void _sway_vlog(const char *filename, int line, log_importance_t verbosity, const char *format, va_list args) { if (verbosity <= v) { @@ -116,6 +106,15 @@ void _sway_log(const char *filename, int line, log_importance_t verbosity, const va_end(args); } + +void _sway_abort(const char *filename, int line, const char* format, ...) { + va_list args; + va_start(args, format); + _sway_vlog(filename, line, L_ERROR, format, args); + va_end(args); + sway_terminate(EXIT_FAILURE); +} + void sway_log_errno(log_importance_t verbosity, char* format, ...) { if (verbosity <= v) { unsigned int c = verbosity; |