From 0358d115e0b1887c63ea3f593c5e2ede44000e79 Mon Sep 17 00:00:00 2001 From: gabime Date: Wed, 4 Jul 2018 00:46:50 +0300 Subject: [PATCH] removed std::string from async messages --- include/spdlog/details/thread_pool.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/spdlog/details/thread_pool.h b/include/spdlog/details/thread_pool.h index c7ee598b..9019823a 100644 --- a/include/spdlog/details/thread_pool.h +++ b/include/spdlog/details/thread_pool.h @@ -29,7 +29,7 @@ struct async_msg level::level_enum level; log_clock::time_point time; size_t thread_id; - std::string txt; + fmt::basic_memory_buffer raw; size_t msg_id; async_logger_ptr worker_ptr; @@ -48,10 +48,10 @@ struct async_msg , level(m.level) , time(m.time) , thread_id(m.thread_id) - , txt(m.raw.data(), m.raw.size()) , msg_id(m.msg_id) , worker_ptr(std::forward(worker)) { + fmt_helper::append_buf(m.raw, raw); } async_msg(async_logger_ptr &&worker, async_msg_type the_type) @@ -71,7 +71,7 @@ struct async_msg msg.level = level; msg.time = time; msg.thread_id = thread_id; - msg.raw.append(txt.data(), txt.data() + txt.size()); + fmt_helper::append_buf(raw, msg.raw); msg.msg_id = msg_id; msg.color_range_start = 0; msg.color_range_end = 0;