// #include #include #ifdef SPDLOG_ACTIVE_LEVEL #include "spdlog/spdlog.h" #else #include #endif /* SPDLOG_ACTIVE_LEVEL */ #ifdef SPDLOG_ACTIVE_LEVEL #define LOG_DEBUG(_msg) \ do { \ std::ostringstream _oss; \ _oss << _msg; \ SPDLOG_DEBUG(_oss.str()); \ } while(0) #else #define LOG_DEBUG(_msg) do { \ std::ostringstream _oss; \ _oss << _msg; \ std::cout << _oss.str() << std::endl; \ } while(0) #endif /* SPDLOG_ACTIVE_LEVEL */ #ifdef SPDLOG_ACTIVE_LEVEL #define LOG_INFO(_msg) \ do { \ std::ostringstream _oss; \ _oss << _msg; \ SPDLOG_INFO(_oss.str()); \ } while(0) #else #define LOG_INFO(_msg) \ do { \ std::ostringstream _oss; \ _oss << _msg; \ std::cout << _oss.str() << std::endl; \ } while(0) #endif /* SPDLOG_ACTIVE_LEVEL */ #ifdef SPDLOG_ACTIVE_LEVEL #define LOG_WARN(_msg) \ do { \ std::ostringstream _oss; \ _oss << _msg; \ SPDLOG_WARN(_oss.str()); \ } while(0) #else #define LOG_WARN(_msg) do { \ std::ostringstream _oss; \ _oss << _msg; \ std::cout << _oss.str() << std::endl; \ } while(0) #endif /* SPDLOG_ACTIVE_LEVEL */ #ifdef SPDLOG_ACTIVE_LEVEL #define LOG_ERROR(_msg) \ do { \ std::ostringstream _oss; \ _oss << _msg; \ SPDLOG_ERROR(_oss.str()); \ } while(0) #else #define LOG_ERROR(_msg) do { \ std::ostringstream _oss; \ _oss << _msg; \ std::cout << _oss.str() << std::endl; \ } while(0) #endif /* SPDLOG_ACTIVE_LEVEL */