aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenutil/include')
-rw-r--r--src/zenutil/include/zenutil/cache/cache.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/zenutil/include/zenutil/cache/cache.h b/src/zenutil/include/zenutil/cache/cache.h
index 1a1dd9386..5e12c488c 100644
--- a/src/zenutil/include/zenutil/cache/cache.h
+++ b/src/zenutil/include/zenutil/cache/cache.h
@@ -4,3 +4,31 @@
#include <zenutil/cache/cachekey.h>
#include <zenutil/cache/cachepolicy.h>
+
+ZEN_THIRD_PARTY_INCLUDES_START
+#include <fmt/format.h>
+ZEN_THIRD_PARTY_INCLUDES_END
+
+namespace zen {
+
+struct CacheRequestContext
+{
+ Oid SessionId{Oid::Zero};
+ uint32_t RequestId{0};
+};
+
+} // namespace zen
+
+template<>
+struct fmt::formatter<zen::CacheRequestContext> : formatter<string_view>
+{
+ template<typename FormatContext>
+ auto format(const zen::CacheRequestContext& Context, FormatContext& ctx)
+ {
+ zen::ExtendableStringBuilder<64> String;
+ Context.SessionId.ToString(String);
+ String << ".";
+ String << Context.RequestId;
+ return formatter<string_view>::format(String.ToView(), ctx);
+ }
+};