From 31d9c3cd7a36b56922f16056f50b7467a79be5cd Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 2 Oct 2023 00:04:20 +0300 Subject: [PATCH] Added comment about log_msg_buffer --- src/details/log_msg_buffer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/details/log_msg_buffer.cpp b/src/details/log_msg_buffer.cpp index b3fd95d5..3cd86a9f 100644 --- a/src/details/log_msg_buffer.cpp +++ b/src/details/log_msg_buffer.cpp @@ -6,6 +6,10 @@ namespace spdlog { namespace details { +// copy logger name and payload to buffer so can be used asynchronously +// note: source location pointers are copied without allocation since they +// are compiler generated const chars* (__FILE__, __LINE__, __FUNCTION__) +// if you pass custom strings to source location, make sure they outlive the log_msg_buffer log_msg_buffer::log_msg_buffer(const log_msg &orig_msg) : log_msg{orig_msg} { buffer.append(logger_name.begin(), logger_name.end());