Pass source loc by ref to log_msg

This commit is contained in:
gabime 2025-01-06 08:06:52 +02:00
parent 04004e57c2
commit adaf0554be
2 changed files with 12 additions and 12 deletions

View File

@ -11,8 +11,8 @@ namespace spdlog {
namespace details {
struct SPDLOG_API log_msg {
log_msg() = default;
log_msg(log_clock::time_point log_time, source_loc loc, string_view_t logger_name, level lvl, string_view_t msg);
log_msg(source_loc loc, string_view_t logger_name, level lvl, string_view_t msg);
log_msg(log_clock::time_point log_time, const source_loc &loc, string_view_t logger_name, level lvl, string_view_t msg);
log_msg(const source_loc &loc, string_view_t logger_name, level lvl, string_view_t msg);
log_msg(string_view_t logger_name, level lvl, string_view_t msg);
log_msg(const log_msg &other) = default;
log_msg &operator=(const log_msg &other) = default;

View File

@ -8,12 +8,12 @@
namespace spdlog {
namespace details {
log_msg::log_msg(spdlog::log_clock::time_point log_time,
spdlog::source_loc loc,
string_view_t a_logger_name,
spdlog::level lvl,
spdlog::string_view_t msg)
: logger_name(a_logger_name),
log_msg::log_msg(const log_clock::time_point log_time,
const source_loc &loc,
const string_view_t logger_name,
const level lvl,
const string_view_t msg)
: logger_name(logger_name),
log_level(lvl),
time(log_time),
#ifdef SPDLOG_NO_THREAD_ID
@ -25,11 +25,11 @@ log_msg::log_msg(spdlog::log_clock::time_point log_time,
payload(msg) {
}
log_msg::log_msg(spdlog::source_loc loc, string_view_t a_logger_name, spdlog::level lvl, spdlog::string_view_t msg)
: log_msg(os::now(), loc, a_logger_name, lvl, msg) {}
log_msg::log_msg(const source_loc &loc, const string_view_t logger_name, const level lvl, const string_view_t msg)
: log_msg(os::now(), loc, logger_name, lvl, msg) {}
log_msg::log_msg(string_view_t a_logger_name, spdlog::level lvl, spdlog::string_view_t msg)
: log_msg(os::now(), source_loc{}, a_logger_name, lvl, msg) {}
log_msg::log_msg(const string_view_t logger_name, const level lvl, const string_view_t msg)
: log_msg(os::now(), source_loc{}, logger_name, lvl, msg) {}
} // namespace details
} // namespace spdlog