7#include <google/protobuf/message.h>
8#include <grpcpp/support/status.h>
10USERVER_NAMESPACE_BEGIN
14inline constexpr std::size_t kDefaultDebugStringLimit = 1024;
61std::string
ToLimitedDebugString(
const grpc::Status& status, std::size_t max_size = kDefaultDebugStringLimit);
81struct formatter<T,
typename std::enable_if_t<std::is_base_of_v<google::protobuf::Message, std::decay_t<T>>,
char>> {
82 constexpr auto parse(format_parse_context& ctx) {
return ctx.begin(); }
84 template <
typename FormatContext>
85 auto format(
const T& message, FormatContext& ctx)
const {
86 return fmt::format_to(
89 USERVER_NAMESPACE::ugrpc::ToLimitedDebugString(message, USERVER_NAMESPACE::ugrpc::kDefaultDebugStringLimit)