X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/3b5b9db0bc2dbe93b3b79e722997606c71ecafb9..a534b3b856a1e3cbfe60bc0bca432e802f9718be:/log.h diff --git a/log.h b/log.h index ed2818f..818f5f2 100644 --- a/log.h +++ b/log.h @@ -9,6 +9,18 @@ #ifndef __LOG_H__ #define __LOG_H__ +#include + +#define log_assert(expr) \ + if (!(expr)) { \ + logthing(LOGTHING_CRITICAL, \ + "Assertion %s failed in %s, line %d", \ + #expr, \ + __FILE__, \ + __LINE__); \ + } \ + assert(expr) + /* * loglevels - levels of severity for a log entry *