diff options
author | Ed Tanous <ed@tanous.net> | 2020-10-03 00:51:22 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2020-10-05 20:43:20 +0300 |
commit | eb643c27fdbc92c9aa17dc70a1c1298b3722b1e7 (patch) | |
tree | 936e9a78c56acc8a3cb030d6e27f46029fb9b8a6 | |
parent | d4d25793d79eeee62a5b7f199410c0578070dce1 (diff) | |
download | bmcweb-eb643c27fdbc92c9aa17dc70a1c1298b3722b1e7.tar.xz |
Fix naming conventions in logger
Tested:
No functional changes.
Change-Id: I10144229b07959de4d8a5d5a471caff8a2b87e6f
Signed-off-by: Ed Tanous <ed@tanous.net>
-rw-r--r-- | http/logging.h | 34 | ||||
-rw-r--r-- | src/webserver_main.cpp | 2 |
2 files changed, 18 insertions, 18 deletions
diff --git a/http/logging.h b/http/logging.h index 4498c3de56..0121729542 100644 --- a/http/logging.h +++ b/http/logging.h @@ -19,7 +19,7 @@ enum class LogLevel Critical, }; -class logger +class Logger { private: // @@ -40,7 +40,7 @@ class logger } public: - logger([[maybe_unused]] const std::string& prefix, + Logger([[maybe_unused]] const std::string& prefix, [[maybe_unused]] const std::string& filename, [[maybe_unused]] const size_t line, LogLevel levelIn) : level(levelIn) @@ -51,9 +51,9 @@ class logger << line << "] "; #endif } - ~logger() + ~Logger() { - if (level >= get_current_log_level()) + if (level >= getCurrentLogLevel()) { #ifdef BMCWEB_ENABLE_LOGGING stringstream << std::endl; @@ -64,9 +64,9 @@ class logger // template <typename T> - logger& operator<<([[maybe_unused]] T const& value) + Logger& operator<<([[maybe_unused]] T const& value) { - if (level >= get_current_log_level()) + if (level >= getCurrentLogLevel()) { #ifdef BMCWEB_ENABLE_LOGGING stringstream << value; @@ -81,7 +81,7 @@ class logger getLogLevelRef() = level; } - static LogLevel get_current_log_level() + static LogLevel getCurrentLogLevel() { return getLogLevelRef(); } @@ -101,17 +101,17 @@ class logger } // namespace crow #define BMCWEB_LOG_CRITICAL \ - if (crow::logger::get_current_log_level() <= crow::LogLevel::Critical) \ - crow::logger("CRITICAL", __FILE__, __LINE__, crow::LogLevel::Critical) + if (crow::Logger::getCurrentLogLevel() <= crow::LogLevel::Critical) \ + crow::Logger("CRITICAL", __FILE__, __LINE__, crow::LogLevel::Critical) #define BMCWEB_LOG_ERROR \ - if (crow::logger::get_current_log_level() <= crow::LogLevel::Error) \ - crow::logger("ERROR", __FILE__, __LINE__, crow::LogLevel::Error) + if (crow::Logger::getCurrentLogLevel() <= crow::LogLevel::Error) \ + crow::Logger("ERROR", __FILE__, __LINE__, crow::LogLevel::Error) #define BMCWEB_LOG_WARNING \ - if (crow::logger::get_current_log_level() <= crow::LogLevel::Warning) \ - crow::logger("WARNING", __FILE__, __LINE__, crow::LogLevel::Warning) + if (crow::Logger::getCurrentLogLevel() <= crow::LogLevel::Warning) \ + crow::Logger("WARNING", __FILE__, __LINE__, crow::LogLevel::Warning) #define BMCWEB_LOG_INFO \ - if (crow::logger::get_current_log_level() <= crow::LogLevel::Info) \ - crow::logger("INFO", __FILE__, __LINE__, crow::LogLevel::Info) + if (crow::Logger::getCurrentLogLevel() <= crow::LogLevel::Info) \ + crow::Logger("INFO", __FILE__, __LINE__, crow::LogLevel::Info) #define BMCWEB_LOG_DEBUG \ - if (crow::logger::get_current_log_level() <= crow::LogLevel::Debug) \ - crow::logger("DEBUG", __FILE__, __LINE__, crow::LogLevel::Debug) + if (crow::Logger::getCurrentLogLevel() <= crow::LogLevel::Debug) \ + crow::Logger("DEBUG", __FILE__, __LINE__, crow::LogLevel::Debug) diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp index 0694b19517..cd31152906 100644 --- a/src/webserver_main.cpp +++ b/src/webserver_main.cpp @@ -59,7 +59,7 @@ inline void setupSocket(crow::App& app) int main(int /*argc*/, char** /*argv*/) { - crow::logger::setLogLevel(crow::LogLevel::Debug); + crow::Logger::setLogLevel(crow::LogLevel::Debug); auto io = std::make_shared<boost::asio::io_context>(); App app(io); |