From a054488f8417a40e22c4e1e0f9738f705785aa9e Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 8 Oct 2024 10:58:25 +0200 Subject: Name type template parameters using CamelCase. --- src/buildtool/logging/logger.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/buildtool/logging/logger.hpp') diff --git a/src/buildtool/logging/logger.hpp b/src/buildtool/logging/logger.hpp index f224edd8..613f2b25 100644 --- a/src/buildtool/logging/logger.hpp +++ b/src/buildtool/logging/logger.hpp @@ -67,13 +67,13 @@ class Logger { void SetLogLimit(LogLevel level) noexcept { log_limit_ = level; } /// \brief Emit log message from string via this logger instance. - template + template void Emit(LogLevel level, std::string const& msg, - T_Args&&... args) const noexcept { + TArgs&&... args) const noexcept { if (static_cast(level) <= static_cast(log_limit_)) { FormatAndForward( - this, sinks_, level, msg, std::forward(args)...); + this, sinks_, level, msg, std::forward(args)...); } } @@ -86,17 +86,17 @@ class Logger { } /// \brief Log message from string via LogConfig's sinks and log limit. - template + template static void Log(LogLevel level, std::string const& msg, - T_Args&&... args) noexcept { + TArgs&&... args) noexcept { if (static_cast(level) <= static_cast(LogConfig::LogLimit())) { FormatAndForward(nullptr, LogConfig::Sinks(), level, msg, - std::forward(args)...); + std::forward(args)...); } } @@ -112,11 +112,11 @@ class Logger { /// \brief Generic logging method. Provides a common interface between the /// global logger and named instances, hidden from the outside caller. /// For named instances no global configuration is used. - template + template static void Log(Logger const* logger, LogLevel level, std::string const& msg, - T_Args&&... args) noexcept { + TArgs&&... args) noexcept { if (static_cast(level) <= static_cast(logger != nullptr ? logger->log_limit_ : LogConfig::LogLimit())) { @@ -125,7 +125,7 @@ class Logger { logger != nullptr ? logger->sinks_ : LogConfig::Sinks(), level, msg, - std::forward(args)...); + std::forward(args)...); } } @@ -153,15 +153,15 @@ class Logger { std::vector sinks_; /// \brief Format message and forward to sinks. - template + template static void FormatAndForward( Logger const* logger, std::vector const& sinks, LogLevel level, std::string const& msg, // NOLINTNEXTLINE(cppcoreguidelines-missing-std-forward) - T_Args&&... args) noexcept { - if constexpr (sizeof...(T_Args) == 0) { + TArgs&&... args) noexcept { + if constexpr (sizeof...(TArgs) == 0) { // forward to sinks std::for_each(sinks.cbegin(), sinks.cend(), [&](auto& sink) { sink->Emit(logger, level, msg); -- cgit v1.2.3