Crow: logging的设计

Crow设计了一套简易并且实用的log系统。

想要输出log的地方只需通过如下语句,就能实现混合输出:

CROW_LOG_DEBUG << " - MESSAGE: " << message;

 看一下CROW_LOG_XXX的定义:

#define CROW_LOG_CRITICAL                                                  \
    if (crow::logger::get_current_log_level() <= crow::LogLevel::Critical) \
    crow::logger(crow::LogLevel::Critical)
#define CROW_LOG_ERROR                                                  \
    if (crow::logger::get_current_log_level() <= crow::LogLevel::Error) \
    crow::logger(crow::LogLevel::Error)
#define CROW_LOG_WARNING                                                  \
    if (crow::logger::get_current_log_level() <= crow::LogLevel::Warning) \
    crow::logger(crow::LogLevel::Warning)
#define CROW_LOG_INFO                                                  \
    if (crow::logger::get_current_log_level() <= crow::LogL

你可能感兴趣的:(Crow,c++)