diff --git a/include/spdlog/details/log_msg.h b/include/spdlog/details/log_msg.h index 71ed7208..d7703625 100644 --- a/include/spdlog/details/log_msg.h +++ b/include/spdlog/details/log_msg.h @@ -45,11 +45,6 @@ struct log_msg mutable size_t color_range_start{0}; mutable size_t color_range_end{0}; - operator fmt::string_view() const SPDLOG_NOEXCEPT - { - return payload; - } - const fmt::string_view payload; }; } // namespace details diff --git a/include/spdlog/details/pattern_formatter.h b/include/spdlog/details/pattern_formatter.h index d1ff0e9c..86833c7e 100644 --- a/include/spdlog/details/pattern_formatter.h +++ b/include/spdlog/details/pattern_formatter.h @@ -404,7 +404,7 @@ class v_formatter final : public flag_formatter { void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override { - fmt_helper::append_string_view(msg, dest); + fmt_helper::append_string_view(msg.payload, dest); } }; @@ -530,7 +530,7 @@ class full_formatter final : public flag_formatter dest.push_back(']'); dest.push_back(' '); // fmt_helper::append_string_view(msg.msg(), dest); - fmt_helper::append_string_view(msg, dest); + fmt_helper::append_string_view(msg.payload, dest); } private: diff --git a/include/spdlog/details/thread_pool.h b/include/spdlog/details/thread_pool.h index 63f27e7b..2743fd1e 100644 --- a/include/spdlog/details/thread_pool.h +++ b/include/spdlog/details/thread_pool.h @@ -78,7 +78,7 @@ struct async_msg , msg_id(m.msg_id) , worker_ptr(std::move(worker)) { - fmt_helper::append_string_view(m, raw); + fmt_helper::append_string_view(m.payload, raw); } async_msg(async_logger_ptr &&worker, async_msg_type the_type) diff --git a/include/spdlog/sinks/android_sink.h b/include/spdlog/sinks/android_sink.h index 1286c173..0742b247 100644 --- a/include/spdlog/sinks/android_sink.h +++ b/include/spdlog/sinks/android_sink.h @@ -47,7 +47,7 @@ protected: fmt::memory_buffer formatted; if (use_raw_msg_) { - details::fmt_helper::append_string_view(msg, formatted); + details::fmt_helper::append_string_view(msg.payload, formatted); } else { diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index d1c78210..4df49b87 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -53,7 +53,7 @@ public: protected: void sink_it_(const details::log_msg &msg) override { - ::syslog(syslog_prio_from_level(msg), "%s", fmt::to_string(msg).c_str()); + ::syslog(syslog_prio_from_level(msg), "%s", fmt::to_string(msg.payload).c_str()); } void flush_() override {}