From eeb22c13bb65f342434c991641b80ecf4821e9b9 Mon Sep 17 00:00:00 2001 From: Philippe Vaucher Date: Wed, 3 Jul 2024 21:51:11 +0200 Subject: [PATCH] Allow customization of syslog_sink (#3124) Thanks @Silex --- include/spdlog/sinks/syslog_sink.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index a2df3b44..913d41be 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -64,13 +64,14 @@ protected: // // Simply maps spdlog's log level to syslog priority level. // - int syslog_prio_from_level(const details::log_msg &msg) const { + virtual int syslog_prio_from_level(const details::log_msg &msg) const { return syslog_levels_.at(static_cast(msg.level)); } -private: using levels_array = std::array; levels_array syslog_levels_; + +private: // must store the ident because the man says openlog might use the pointer as // is and not a string copy const std::string ident_;