From 967554e4c50a8df02585ec43b47a3f048fd5c17e Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 25 Sep 2023 16:45:11 +0300 Subject: [PATCH] added comments --- include/spdlog/logger.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 593b4a9d..a912a138 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -109,7 +109,8 @@ public: } } -#ifdef SPDLOG_SOURCE_LOCATION +#ifdef SPDLOG_SOURCE_LOCATION // off by default. define SPDLOG_SOURCE_LOCATION before including + // spdlog to enable. template void trace(loc_with_fmt fmt, Args &&...args) { log(fmt.loc, level::trace, fmt.fmt_string, std::forward(args)...); @@ -165,7 +166,7 @@ public: void critical(string_view_t msg, source_loc loc = source_loc::current()) { log(loc, level::critical, msg); } -#else +#else // without source location template void trace(format_string_t fmt, Args &&...args) { log(level::trace, fmt, std::forward(args)...); @@ -198,17 +199,12 @@ public: // log functions with no format string, just string void trace(string_view_t msg) { log(level::trace, msg); } - void debug(string_view_t msg) { log(level::debug, msg); } - void info(string_view_t msg) { log(level::info, msg); } - - inline void warn(string_view_t msg) { log(level::warn, msg); } - + void warn(string_view_t msg) { log(level::warn, msg); } void error(string_view_t msg) { log(level::err, msg); } - void critical(string_view_t msg) { log(level::critical, msg); } -#endif +#endif // SPDLOG_SOURCE_LOCATION // return true if logging is enabled for the given level. [[nodiscard]] bool should_log(level msg_level) const { @@ -241,7 +237,6 @@ public: // sinks [[nodiscard]] const std::vector &sinks() const; - [[nodiscard]] std::vector &sinks(); // error handler