X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=log.h;h=818f5f2d96ef61162080bfb79a028d25c3f640f8;hb=8b4052ad6015aa9f54c9c824f28655f230d09d8d;hp=ed2818f29e8b4b3d929cb2c6b8b63d2439b7e263;hpb=3eae5368f1c625257a93a18bec49a5a500b3f78e;p=onak.git 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 *