summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2023-05-12 17:57:16 +0300
committerPatrick Williams <patrick@stwcx.xyz>2023-05-12 18:19:12 +0300
commiteb8a39988187af0eb9e51f828f96b4d96bdec906 (patch)
tree1f2041be5ff2abbf777b0de3ae0d5b381a252efe
parent6da47bab464597745e5cb3e669ed52e78da831d3 (diff)
downloadbmcweb-eb8a39988187af0eb9e51f828f96b4d96bdec906.tar.xz
http-logging: fix clang-tidy warnings
``` /data0/jenkins/workspace/ci-repository/openbmc/bmcweb/http/logging.hpp:132:9: error: macro is not used [clang-diagnostic-unused-macros,-warnings-as-errors] #define BMCWEB_LOG_CRITICAL ``` Add NOLINTBEGIN/NOLINTEND guards around the whole of the macro definitions because there are now multiple clang-tidy warning types that call out this behavior, but we want it in this case. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Iac2ee839999f36424ca6dfed212d0bad0a2f3ae5
-rw-r--r--http/logging.hpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/http/logging.hpp b/http/logging.hpp
index ed0c7f7c0b..368548f9c0 100644
--- a/http/logging.hpp
+++ b/http/logging.hpp
@@ -124,31 +124,30 @@ class Logger
};
} // namespace crow
+// Disable clang-tidy warnings about unused macros.
+// NOLINTBEGIN(cppcoreguidelines-macro-usage, clang-diagnostic-unused-macros)
+
// The logging functions currently use macros. Now that we have c++20, ideally
// they'd use source_location with fixed functions, but for the moment, disable
// the check.
-
-// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BMCWEB_LOG_CRITICAL \
if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Critical)) \
crow::Logger("CRITICAL", __FILE__, __LINE__)
-// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BMCWEB_LOG_ERROR \
if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Error)) \
crow::Logger("ERROR", __FILE__, __LINE__)
-// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BMCWEB_LOG_WARNING \
if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Warning)) \
crow::Logger("WARNING", __FILE__, __LINE__)
-// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BMCWEB_LOG_INFO \
if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Info)) \
crow::Logger("INFO", __FILE__, __LINE__)
-// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BMCWEB_LOG_DEBUG \
if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Debug)) \
crow::Logger("DEBUG", __FILE__, __LINE__)
+
+// NOLINTEND(cppcoreguidelines-macro-usage, clang-diagnostic-unused-macros)