aboutsummaryrefslogtreecommitdiffstats
path: root/include/logging.h
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2016-08-27 14:15:16 +0900
committeripknHama <ipknhama@gmail.com>2016-08-27 14:15:16 +0900
commit9e851ec896d2bbfdec869dbb6e6968b1afc913f0 (patch)
tree37681aa6c0df109d712136267ffa58cc38f70832 /include/logging.h
parent8138d212ffbd9c251ad9c29216cf2790a22e6ff0 (diff)
downloadcrow-9e851ec896d2bbfdec869dbb6e6968b1afc913f0.tar.gz
crow-9e851ec896d2bbfdec869dbb6e6968b1afc913f0.zip
Handling macro issues
- fix IS_NUM conflict (for MySQL) - avoid DELETE, ERROR (for Windows)
Diffstat (limited to 'include/logging.h')
-rw-r--r--include/logging.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/include/logging.h b/include/logging.h
index b915e6e..41ac0ab 100644
--- a/include/logging.h
+++ b/include/logging.h
@@ -13,11 +13,19 @@ namespace crow
{
enum class LogLevel
{
- DEBUG,
+#ifndef ERROR
+ DEBUG = 0,
INFO,
WARNING,
ERROR,
CRITICAL,
+#endif
+
+ Debug = 0,
+ Info,
+ Warning,
+ Error,
+ Critical,
};
class ILogHandler {
@@ -117,18 +125,18 @@ namespace crow
}
#define CROW_LOG_CRITICAL \
- if (crow::logger::get_current_log_level() <= crow::LogLevel::CRITICAL) \
- crow::logger("CRITICAL", crow::LogLevel::CRITICAL)
+ if (crow::logger::get_current_log_level() <= crow::LogLevel::Critical) \
+ crow::logger("CRITICAL", crow::LogLevel::Critical)
#define CROW_LOG_ERROR \
- if (crow::logger::get_current_log_level() <= crow::LogLevel::ERROR) \
- crow::logger("ERROR ", crow::LogLevel::ERROR)
+ if (crow::logger::get_current_log_level() <= crow::LogLevel::Error) \
+ crow::logger("ERROR ", crow::LogLevel::Error)
#define CROW_LOG_WARNING \
- if (crow::logger::get_current_log_level() <= crow::LogLevel::WARNING) \
- crow::logger("WARNING ", crow::LogLevel::WARNING)
+ if (crow::logger::get_current_log_level() <= crow::LogLevel::Warning) \
+ crow::logger("WARNING ", crow::LogLevel::Warning)
#define CROW_LOG_INFO \
- if (crow::logger::get_current_log_level() <= crow::LogLevel::INFO) \
- crow::logger("INFO ", crow::LogLevel::INFO)
+ if (crow::logger::get_current_log_level() <= crow::LogLevel::Info) \
+ crow::logger("INFO ", crow::LogLevel::Info)
#define CROW_LOG_DEBUG \
- if (crow::logger::get_current_log_level() <= crow::LogLevel::DEBUG) \
- crow::logger("DEBUG ", crow::LogLevel::DEBUG)
+ if (crow::logger::get_current_log_level() <= crow::LogLevel::Debug) \
+ crow::logger("DEBUG ", crow::LogLevel::Debug)