X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/3b5b9db0bc2dbe93b3b79e722997606c71ecafb9..38673288bad5b2c0f730021d9311e2df73c74c82:/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 *