aboutsummaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-20 16:47:05 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-20 16:47:05 +0000
commitc5031be4899ea516635ef7c65a6f82b3b45860b9 (patch)
tree10948eb4aface28e80d6a075fecf11fad3075618 /log.c
parentMerge branch 'decset-1047-and-1048' (diff)
parentdebug: rename assert() to xassert(), to avoid clashing with <assert.h> (diff)
Merge branch 'stacktrace'
Diffstat (limited to 'log.c')
-rw-r--r--log.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/log.c b/log.c
index d47e22ac..24d26ed0 100644
--- a/log.c
+++ b/log.c
@@ -1,15 +1,15 @@
#include "log.h"
-#include <stdlib.h>
-#include <stdio.h>
+#include <errno.h>
#include <stdarg.h>
-#include <string.h>
#include <stdbool.h>
-#include <errno.h>
-#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
#include <unistd.h>
-#include <syslog.h>
+#include "debug.h"
static bool colorize = false;
static bool do_syslog = true;
@@ -94,11 +94,11 @@ _sys_log(enum log_class log_class, const char *module,
case LOG_CLASS_DEBUG: level = LOG_DEBUG; break;
}
- assert(level != -1);
+ xassert(level != -1);
char msg[4096];
int n = vsnprintf(msg, sizeof(msg), fmt, va);
- assert(n >= 0);
+ xassert(n >= 0);
if (sys_errno != 0 && (size_t)n < sizeof(msg))
snprintf(msg + n, sizeof(msg) - n, ": %s", strerror(sys_errno));