How to log Protobuf string in nested objects in a human-readable way?

后端 未结 2 777
栀梦
栀梦 2021-01-23 18:19

Given a proto file:

syntax = "proto3";
package hello;

message TopGreeting {
    NestedGreeting greeting = 1;
}

message NestedGreeting {
    Greeting g         


        
2条回答
  •  花落未央
    2021-01-23 18:57

    The protobuf binary format isn't human readable and you shouldn't attempt to make it so. There is a JSON variant if you need, but frankly it would be better to log the interpreted data, not the payloads.

提交回复
热议问题