diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-11-19 21:20:13 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-11-19 22:05:53 -0700 |
commit | 24cd8ca4ee1ea08526eb82e6c122870c86da5603 (patch) | |
tree | 25e467df0236b8a514bbc328299f8500277f9512 /libmisc/assert.c | |
parent | 1cc68fb6f72ada5446a9914cc3bf97db9259a880 (diff) |
Add libmisc/log.h to remove stdio.h
Diffstat (limited to 'libmisc/assert.c')
-rw-r--r-- | libmisc/assert.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libmisc/assert.c b/libmisc/assert.c index 911cea3..dbf25b7 100644 --- a/libmisc/assert.c +++ b/libmisc/assert.c @@ -5,9 +5,11 @@ */ #include <stdbool.h> /* for bool, true, false */ -#include <stdio.h> /* for printf() */ #include <stdlib.h> /* for abort() */ +#define LOG_NAME ASSERT +#include <libmisc/log.h> /* for errorf() */ + #include <libmisc/assert.h> #ifndef NDEBUG @@ -18,7 +20,7 @@ void __assert_msg_fail(const char *expr, static bool in_fail = false; if (!in_fail) { in_fail = true; - printf("error: %s:%u:%s(): assertion \"%s\" failed%s%s\n", + errorf("%s:%u:%s(): assertion \"%s\" failed%s%s", file, line, func, expr, msg ? ": " : "", msg); |