fixed some rebase errors

This commit is contained in:
M4rFri 2025-02-11 11:26:43 +01:00
parent ef054062c4
commit 85a05357ae
3 changed files with 11 additions and 35 deletions

View File

@ -13,14 +13,14 @@ namespace details {
struct SPDLOG_API log_msg {
log_msg() = default;
log_msg(log_clock::time_point log_time,
source_loc loc,
const source_loc &loc,
string_view_t logger_name,
level lvl,
string_view_t msg,
log_attributes attributes);
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(source_loc loc, string_view_t logger_name, level lvl, string_view_t msg, log_attributes attributes);
log_msg(const source_loc &loc, string_view_t logger_name, level lvl, string_view_t msg, log_attributes attributes);
log_msg(string_view_t logger_name, level lvl, string_view_t msg, log_attributes attributes);
log_msg(string_view_t logger_name, level lvl, string_view_t msg);
log_msg(const log_msg &other) = default;

View File

@ -8,32 +8,13 @@
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,
spdlog::log_attributes attributes)
: logger_name(a_logger_name),
log_level(lvl),
time(log_time)
#ifndef SPDLOG_NO_THREAD_ID
,
thread_id(os::thread_id())
#endif
,
source(loc),
payload(msg),
attributes(attributes) {
}
log_msg::log_msg(const log_clock::time_point log_time,
const source_loc loc,
const string_view_t a_logger_name,
const source_loc &loc,
const string_view_t logger_name,
const level lvl,
const string_view_t msg,
const log_attributes attributes)
: logger_name(a_logger_name),
: logger_name(logger_name),
log_level(lvl),
time(log_time),
#ifdef SPDLOG_NO_THREAD_ID
@ -64,20 +45,16 @@ log_msg::log_msg(const log_clock::time_point log_time,
}
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(os::now(), loc, logger_name, lvl, msg, {}) {}
log_msg::log_msg(spdlog::source_loc loc,
string_view_t a_logger_name,
spdlog::level lvl,
spdlog::string_view_t msg,
spdlog::log_attributes attributes)
: log_msg(os::now(), loc, a_logger_name, lvl, msg, attributes) {}
log_msg::log_msg(const source_loc &loc, string_view_t logger_name, level lvl, string_view_t msg, log_attributes attributes)
: log_msg(os::now(), loc, logger_name, lvl, msg, attributes) {}
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) {}
log_msg::log_msg(string_view_t a_logger_name, spdlog::level lvl, spdlog::string_view_t msg, spdlog::log_attributes attributes)
: log_msg(os::now(), source_loc{}, a_logger_name, lvl, msg, attributes) {}
log_msg::log_msg(const string_view_t logger_name, const level lvl, const string_view_t msg, const log_attributes attributes)
: log_msg(os::now(), source_loc{}, logger_name, lvl, msg, attributes) {}
} // namespace details
} // namespace spdlog

View File

@ -1,7 +1,6 @@
#include <future>
#include "includes.h"
#include "spdlog/mdc.h"
#include "spdlog/sinks/stdout_sinks.h"
#include "spdlog/spdlog.h"
#include "test_sink.h"
@ -182,7 +181,7 @@ TEST_CASE("attribute test - multi threaded") {
// put attributes with multiple threads simultaneously
std::vector<std::future<void>> tasks;
for (unsigned int i = 0; i < n_tasks; ++i) {
auto task = std::async([&logger, i] {
auto task = std::async([&logger, i, n_values] {
for (auto j = 0; j < n_values; ++j)
logger.attrs().put(fmt_lib::format("log_{}_key_{}", i, j), fmt_lib::format("log_{}_value_{}", i, j));
});