dump_named_fmt() allows to dump a named field using an fmtlib-style
format string (improving code clarity and performance).
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
#include <stdarg.h>
+#include "common/fmt_common.h"
+
namespace ceph {
struct FormatterAttrs {
return nullptr;
}
virtual void write_bin_data(const char* buff, int buf_len);
+
+ template <typename... Args>
+ void dump_named_fmt(std::string_view name, fmt::format_string<Args...> fmtformat, Args&&... args)
+ {
+ dump_string(name, fmt::format(fmtformat, std::forward<Args>(args)...));
+ }
};
std::string fixed_to_string(int64_t num, int scale);