diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-01-20 16:47:05 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-20 16:47:05 +0000 |
| commit | c5031be4899ea516635ef7c65a6f82b3b45860b9 (patch) | |
| tree | 10948eb4aface28e80d6a075fecf11fad3075618 /log.c | |
| parent | Merge branch 'decset-1047-and-1048' (diff) | |
| parent | debug: rename assert() to xassert(), to avoid clashing with <assert.h> (diff) | |
Merge branch 'stacktrace'
Diffstat (limited to 'log.c')
| -rw-r--r-- | log.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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)); |
