diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-22 13:04:24 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-26 23:01:53 +0200 |
commit | 085e99d1fcd7fc8265c69292ff3dbe30167d5b38 (patch) | |
tree | 742902fa76d92c04f6927380185227a45e2463f4 | |
parent | dd0b8328b6f5f573f077ed9d286a82b0d3262005 (diff) |
compat/warn: thingies
-rw-r--r-- | compat/warn.hpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/compat/warn.hpp b/compat/warn.hpp index 9b610d4a..403a3a45 100644 --- a/compat/warn.hpp +++ b/compat/warn.hpp @@ -43,26 +43,25 @@ never_inline void warn_(const char* file, int line, const char* level, const xs& } // ns warn_detail +// todo add runtime loglevel + #define otr_impl_warn_base(level, ...) \ (warn_detail::warn_(__FILE__, __LINE__, (level), __VA_ARGS__)) -#define warn(...) \ +#define dbg_warn(...) \ otr_impl_warn_base("WARN", __VA_ARGS__) -#define debug(...) \ - otr_impl_warn_base("DEBUG", __VA_ARGS__) +#define dbg_log(...) \ + otr_impl_warn_base("INFO", __VA_ARGS__) -#define crit(...) \ +#define dbg_crit(...) \ otr_impl_warn_base("CRIT", __VA_ARGS__) -#if 0 -#include <utility> +#include <cstdlib> -#define fatal(...) \ +#define dbg_fatal(...) \ do \ { \ - otr_impl_warn_base("CRIT", __VA_ARGS__); \ - *(volatile int*)0 = 0; \ - std::quick_exit(255); \ + otr_impl_warn_base("FATAL", __VA_ARGS__); \ + std::abort(); \ } while (0) -#endif |