1#include <google/protobuf/json/json.h>
2#include <google/protobuf/message.h>
4#include <userver/proto-structs/json.hpp>
5#include <userver/protobuf/string.hpp>
11logging::LogHelper& LogMessage(logging::LogHelper& h,
const google::protobuf::Message& message) {
12 auto options = google::protobuf::json::PrintOptions();
13 options.always_print_primitive_fields =
true;
14 options.preserve_proto_field_names =
true;
16 protobuf::ProtoStringType out;
17 const auto status = google::protobuf::json::MessageToJsonString(message, &out, options);
21 return h <<
"Failed to log struct: " << status;