]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: fix fmt::format_to deprecated warning 44352/head
author胡玮文 <huww98@outlook.com>
Sun, 19 Dec 2021 06:47:20 +0000 (14:47 +0800)
committer胡玮文 <huww98@outlook.com>
Sun, 19 Dec 2021 07:39:46 +0000 (15:39 +0800)
Signed-off-by: 胡玮文 <huww98@outlook.com>
src/common/Journald.cc

index 5207608d1a3131739907693e542e9a65ccac6af4..e3ae2d358f402bfed93a41ed1a123ca58ae1999a 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <endian.h>
 #include <fcntl.h>
+#include <iterator>
 #include <memory>
 #include <string>
 #include <sys/mman.h>
@@ -107,7 +108,7 @@ class EntryEncoder : public EntryEncoderBase {
   void encode(const Entry& e, const SubsystemMap *s)
   {
     meta_buf.clear();
-    fmt::format_to(meta_buf,
+    fmt::format_to(std::back_inserter(meta_buf),
       R"(PRIORITY={:d}
 CEPH_SUBSYS={}
 TIMESTAMP={}
@@ -138,7 +139,7 @@ class LogEntryEncoder : public EntryEncoderBase {
   void encode(const LogEntry& le)
   {
     meta_buf.clear();
-    fmt::format_to(meta_buf,
+    fmt::format_to(std::back_inserter(meta_buf),
       R"(PRIORITY={:d}
 TIMESTAMP={}
 CEPH_NAME={}