added comments

This commit is contained in:
gabime 2023-09-25 16:45:11 +03:00
parent 605f037e4e
commit 967554e4c5

View File

@ -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 <typename... Args>
void trace(loc_with_fmt fmt, Args &&...args) {
log(fmt.loc, level::trace, fmt.fmt_string, std::forward<Args>(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 <typename... Args>
void trace(format_string_t<Args...> fmt, Args &&...args) {
log(level::trace, fmt, std::forward<Args>(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<sink_ptr> &sinks() const;
[[nodiscard]] std::vector<sink_ptr> &sinks();
// error handler