logging.hpp (89492a157c9cf972b342421e24d41fd382510251) | logging.hpp (eb8a39988187af0eb9e51f828f96b4d96bdec906) |
---|---|
1#pragma once 2 3#include "bmcweb_config.h" 4 5#include <algorithm> 6#include <array> 7#include <cstdio> 8#include <cstdlib> --- 110 unchanged lines hidden (view full) --- 119 } 120 121 private: 122 // 123 std::ostringstream stringstream; 124}; 125} // namespace crow 126 | 1#pragma once 2 3#include "bmcweb_config.h" 4 5#include <algorithm> 6#include <array> 7#include <cstdio> 8#include <cstdlib> --- 110 unchanged lines hidden (view full) --- 119 } 120 121 private: 122 // 123 std::ostringstream stringstream; 124}; 125} // namespace crow 126 |
127// Disable clang-tidy warnings about unused macros. 128// NOLINTBEGIN(cppcoreguidelines-macro-usage, clang-diagnostic-unused-macros) 129 |
|
127// The logging functions currently use macros. Now that we have c++20, ideally 128// they'd use source_location with fixed functions, but for the moment, disable 129// the check. | 130// The logging functions currently use macros. Now that we have c++20, ideally 131// they'd use source_location with fixed functions, but for the moment, disable 132// the check. |
130 131// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) | |
132#define BMCWEB_LOG_CRITICAL \ 133 if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Critical)) \ 134 crow::Logger("CRITICAL", __FILE__, __LINE__) 135 | 133#define BMCWEB_LOG_CRITICAL \ 134 if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Critical)) \ 135 crow::Logger("CRITICAL", __FILE__, __LINE__) 136 |
136// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) | |
137#define BMCWEB_LOG_ERROR \ 138 if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Error)) \ 139 crow::Logger("ERROR", __FILE__, __LINE__) 140 | 137#define BMCWEB_LOG_ERROR \ 138 if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Error)) \ 139 crow::Logger("ERROR", __FILE__, __LINE__) 140 |
141// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) | |
142#define BMCWEB_LOG_WARNING \ 143 if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Warning)) \ 144 crow::Logger("WARNING", __FILE__, __LINE__) 145 | 141#define BMCWEB_LOG_WARNING \ 142 if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Warning)) \ 143 crow::Logger("WARNING", __FILE__, __LINE__) 144 |
146// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) | |
147#define BMCWEB_LOG_INFO \ 148 if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Info)) \ 149 crow::Logger("INFO", __FILE__, __LINE__) 150 | 145#define BMCWEB_LOG_INFO \ 146 if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Info)) \ 147 crow::Logger("INFO", __FILE__, __LINE__) 148 |
151// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) | |
152#define BMCWEB_LOG_DEBUG \ 153 if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Debug)) \ 154 crow::Logger("DEBUG", __FILE__, __LINE__) | 149#define BMCWEB_LOG_DEBUG \ 150 if constexpr (crow::Logger::checkLoggingLevel(crow::LogLevel::Debug)) \ 151 crow::Logger("DEBUG", __FILE__, __LINE__) |
152 153// NOLINTEND(cppcoreguidelines-macro-usage, clang-diagnostic-unused-macros) |
|