From fdfee8e9051a572273e362a370699b20b8731d3b Mon Sep 17 00:00:00 2001 From: Alexander Gololobov Date: Tue, 9 Apr 2024 18:18:27 +0200 Subject: [PATCH] Fix printing OpNum that are not in default magic_enum range --- src/Common/ZooKeeper/ZooKeeperConstants.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Common/ZooKeeper/ZooKeeperConstants.h b/src/Common/ZooKeeper/ZooKeeperConstants.h index a5c1d21eda6..6349cc058d4 100644 --- a/src/Common/ZooKeeper/ZooKeeperConstants.h +++ b/src/Common/ZooKeeper/ZooKeeperConstants.h @@ -2,6 +2,7 @@ #include #include +#include namespace Coordination @@ -64,3 +65,11 @@ static constexpr int32_t DEFAULT_OPERATION_TIMEOUT_MS = 10000; static constexpr int32_t DEFAULT_CONNECTION_TIMEOUT_MS = 1000; } + +/// This is used by fmt::format to print OpNum as strings. +/// All OpNum values shoud be in range [min, max] to be printed. +template <> +struct magic_enum::customize::enum_range { + static constexpr int min = -100; + static constexpr int max = 1000; +};