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