diff --git a/core/spdlogfactory/logger.hpp b/core/spdlogfactory/logger.hpp index e772f68..9055994 100644 --- a/core/spdlogfactory/logger.hpp +++ b/core/spdlogfactory/logger.hpp @@ -12,15 +12,14 @@ #include #include #include -#include "spdlog/spdlog.h" -#include "iflytopcpp/core/spdlogfactory/logger_factory.hpp" #include "iflytopcpp/core/basic/nlohmann/json.hpp" - - +#include "iflytopcpp/core/spdlogfactory/logger_factory.hpp" #include "spdlog/fmt/ostr.h" +#include "spdlog/spdlog.h" extern "C" { #include + #include "linux/input-event-codes.h" } @@ -61,6 +60,13 @@ ENABLE_BASIC_TYPE_LOGGER(double) // dump input event template static inline OStream &operator<<(OStream &os, struct input_event &event) { - return os << fmt::format("input-event {} {} {}", event.type, event.code, - event.value); + return os << fmt::format("input-event {} {} {}", event.type, event.code, event.value); } + +#define ZCHECK(exptr, info) \ + { \ + if (!(exptr)) { \ + logger->critical("({}:{})ZCHECK failed: {} {}", __FILE__, __LINE__, info, #exptr); \ + exit(-1); \ + } \ + }