Skip to content

Commit 85a0535

Browse files
committed
fixed some rebase errors
1 parent ef05406 commit 85a0535

File tree

3 files changed

+11
-35
lines changed

3 files changed

+11
-35
lines changed

include/spdlog/details/log_msg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ namespace details {
1313
struct SPDLOG_API log_msg {
1414
log_msg() = default;
1515
log_msg(log_clock::time_point log_time,
16-
source_loc loc,
16+
const source_loc &loc,
1717
string_view_t logger_name,
1818
level lvl,
1919
string_view_t msg,
2020
log_attributes attributes);
2121
log_msg(log_clock::time_point log_time, const source_loc &loc, string_view_t logger_name, level lvl, string_view_t msg);
2222
log_msg(const source_loc &loc, string_view_t logger_name, level lvl, string_view_t msg);
23-
log_msg(source_loc loc, string_view_t logger_name, level lvl, string_view_t msg, log_attributes attributes);
23+
log_msg(const source_loc &loc, string_view_t logger_name, level lvl, string_view_t msg, log_attributes attributes);
2424
log_msg(string_view_t logger_name, level lvl, string_view_t msg, log_attributes attributes);
2525
log_msg(string_view_t logger_name, level lvl, string_view_t msg);
2626
log_msg(const log_msg &other) = default;

src/details/log_msg.cpp

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,13 @@
88
namespace spdlog {
99
namespace details {
1010

11-
log_msg::log_msg(spdlog::log_clock::time_point log_time,
12-
spdlog::source_loc loc,
13-
string_view_t a_logger_name,
14-
spdlog::level lvl,
15-
spdlog::string_view_t msg,
16-
spdlog::log_attributes attributes)
17-
: logger_name(a_logger_name),
18-
log_level(lvl),
19-
time(log_time)
20-
#ifndef SPDLOG_NO_THREAD_ID
21-
,
22-
thread_id(os::thread_id())
23-
#endif
24-
,
25-
source(loc),
26-
payload(msg),
27-
attributes(attributes) {
28-
}
29-
3011
log_msg::log_msg(const log_clock::time_point log_time,
31-
const source_loc loc,
32-
const string_view_t a_logger_name,
12+
const source_loc &loc,
13+
const string_view_t logger_name,
3314
const level lvl,
3415
const string_view_t msg,
3516
const log_attributes attributes)
36-
: logger_name(a_logger_name),
17+
: logger_name(logger_name),
3718
log_level(lvl),
3819
time(log_time),
3920
#ifdef SPDLOG_NO_THREAD_ID
@@ -64,20 +45,16 @@ log_msg::log_msg(const log_clock::time_point log_time,
6445
}
6546

6647
log_msg::log_msg(const source_loc &loc, const string_view_t logger_name, const level lvl, const string_view_t msg)
67-
: log_msg(os::now(), loc, logger_name, lvl, msg) {}
48+
: log_msg(os::now(), loc, logger_name, lvl, msg, {}) {}
6849

69-
log_msg::log_msg(spdlog::source_loc loc,
70-
string_view_t a_logger_name,
71-
spdlog::level lvl,
72-
spdlog::string_view_t msg,
73-
spdlog::log_attributes attributes)
74-
: log_msg(os::now(), loc, a_logger_name, lvl, msg, attributes) {}
50+
log_msg::log_msg(const source_loc &loc, string_view_t logger_name, level lvl, string_view_t msg, log_attributes attributes)
51+
: log_msg(os::now(), loc, logger_name, lvl, msg, attributes) {}
7552

7653
log_msg::log_msg(const string_view_t logger_name, const level lvl, const string_view_t msg)
7754
: log_msg(os::now(), source_loc{}, logger_name, lvl, msg) {}
7855

79-
log_msg::log_msg(string_view_t a_logger_name, spdlog::level lvl, spdlog::string_view_t msg, spdlog::log_attributes attributes)
80-
: log_msg(os::now(), source_loc{}, a_logger_name, lvl, msg, attributes) {}
56+
log_msg::log_msg(const string_view_t logger_name, const level lvl, const string_view_t msg, const log_attributes attributes)
57+
: log_msg(os::now(), source_loc{}, logger_name, lvl, msg, attributes) {}
8158

8259
} // namespace details
8360
} // namespace spdlog

tests/test_attributes.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <future>
22

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

0 commit comments

Comments
 (0)