osd: formatter for pg_log_op_return_item_t

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
This commit is contained in:
Ronen Friedman 2023-08-04 11:11:18 -05:00
parent 4f5356d062
commit 6590e56b42
2 changed files with 10 additions and 1 deletions

View File

@ -4223,6 +4223,16 @@ struct pg_log_op_return_item_t {
}
};
WRITE_CLASS_ENCODER(pg_log_op_return_item_t)
namespace fmt {
template <>
struct formatter<pg_log_op_return_item_t> {
constexpr auto parse(fmt::format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
auto format(const pg_log_op_return_item_t& litm, FormatContext& ctx) const {
return fmt::format_to(ctx.out(), "r={}+{}b", litm.rval, litm.bl.length());
}
};
} // namespace fmt
/**
* pg_log_entry_t - single entry/event in pg log

View File

@ -329,7 +329,6 @@ struct fmt::formatter<ScrubMap> {
};
#if FMT_VERSION >= 90000
template <> struct fmt::formatter<pg_log_op_return_item_t> : fmt::ostream_formatter {};
template <> struct fmt::formatter<watch_info_t> : fmt::ostream_formatter {};
template <bool TrackChanges> struct fmt::formatter<pg_missing_set<TrackChanges>> : fmt::ostream_formatter {};
#endif