diff --git a/src/log.h b/src/log.h index 6da5a36..7fd9b68 100644 --- a/src/log.h +++ b/src/log.h @@ -1,21 +1,17 @@ #pragma once #include <stdio.h> - -/* We'll use asserts in DEBUG if defined. */ -#ifndef DEBUG -# define NODEBUG -#endif /* DEBUG */ -#include <assert.h> +#include <signal.h> #define LOG(str, args...)(fprintf(stdout, str"\n", ## args)) #ifdef DEBUG_PARANOID /* Will cause WARN's to blow up. */ -#define WARN(str, args...)(fprintf(stderr, "Warning: [%s] "str"\n", __func__, ## args), assert(0)) +#define WARN(str, args...)(fprintf(stderr, "Warning: [%s] "str"\n", __func__, ## args), \ + raise(SIGRAP)) #else #define WARN(str, args...)(fprintf(stderr, "Warning: [%s] "str"\n", __func__, ## args)) #endif #define ERR(str, args...) (fprintf(stderr, "ERROR %s:%d: [%s] "str"\n", \ - __FILE__, __LINE__, __func__, ## args), assert(0)) + __FILE__, __LINE__, __func__, ## args), raise(SIGTRAP)) #ifdef DEBUG # undef DEBUG