userver: userver/ugrpc/protobuf_logging.hpp File Reference
Loading...
Searching...
No Matches
protobuf_logging.hpp File Reference

Detailed Description

Public API for protobuf logging utilities.

Definition in file protobuf_logging.hpp.

Go to the source code of this file.

#include <limits>
#include <fmt/format.h>
#include <google/protobuf/message.h>
#include <grpcpp/support/status.h>

Classes

struct  fmt::formatter< T >
 fmt::format support for protobuf messages More...

Namespaces

namespace  ugrpc
 Asynchronous gRPC driver.
namespace  fmt
 {fmt} compatibility shims across supported versions.

Functions

std::string ugrpc::ToLimitedLoggingString (const google::protobuf::Message &message, std::size_t limit=kDefaultLoggingStringLimit) noexcept
 Convert protobuf message to a limited JSON string for logging.
std::string ugrpc::ToUnlimitedLoggingString (const google::protobuf::Message &message) noexcept
 Convert protobuf message to an unlimited JSON string for logging.
std::string ugrpc::ToLimitedLoggingString (const grpc::Status &status, std::size_t limit=kDefaultLoggingStringLimit) noexcept
 Get error details from grpc::Status for logging with size limit.
std::string ugrpc::ToUnlimitedLoggingString (const grpc::Status &status) noexcept
 Get error details from grpc::Status for logging without size limit.

Variables

constexpr std::size_t ugrpc::kDefaultLoggingStringLimit = 1024