diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 5bd24c0f..3bd9e7d9 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -197,8 +197,13 @@ struct source_loc , line(line) { } - const char *const filename; - const uint32_t line; +// +// source_loc (const source_loc&) = default; +// source_loc& operator=(const source_loc&) = default; +// source_loc& operator=(source_loc&&) = default; + + const char *filename; + uint32_t line; }; namespace details { diff --git a/include/spdlog/details/thread_pool.h b/include/spdlog/details/thread_pool.h index a1c07d3f..35578971 100644 --- a/include/spdlog/details/thread_pool.h +++ b/include/spdlog/details/thread_pool.h @@ -33,6 +33,7 @@ struct async_msg fmt::basic_memory_buffer raw; size_t msg_id; + source_loc source; async_logger_ptr worker_ptr; async_msg() = default; @@ -49,6 +50,7 @@ struct async_msg thread_id(other.thread_id), raw(move(other.raw)), msg_id(other.msg_id), + source(other.source), worker_ptr(std::move(other.worker_ptr)) { } @@ -61,6 +63,7 @@ struct async_msg thread_id = other.thread_id; raw = std::move(other.raw); msg_id = other.msg_id; + source = other.source; worker_ptr = std::move(other.worker_ptr); return *this; } @@ -76,6 +79,7 @@ struct async_msg , time(m.time) , thread_id(m.thread_id) , msg_id(m.msg_id) + , source(m.source) , worker_ptr(std::move(worker)) { fmt_helper::append_string_view(m.payload, raw); @@ -87,6 +91,7 @@ struct async_msg , time() , thread_id(0) , msg_id(0) + , source() , worker_ptr(std::move(worker)) { } @@ -103,6 +108,7 @@ struct async_msg msg.time = time; msg.thread_id = thread_id; msg.msg_id = msg_id; + msg.source = source; msg.color_range_start = 0; msg.color_range_end = 0; return msg;