Skip to content

Commit

Permalink
feat(common): make the RPC log even more readable
Browse files Browse the repository at this point in the history
- Expand google.protobuf.Any payloads rather than printing their
  serialized content.
- Print fields in the order defined in source code instead of by
  the field number.
  • Loading branch information
devbww committed Jul 14, 2022
1 parent a30eb8b commit a87efbf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions google/cloud/internal/log_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ std::string DebugString(google::protobuf::Message const& m,
p.SetUseShortRepeatedPrimitives(options.use_short_repeated_primitives());
p.SetTruncateStringFieldLongerThan(
options.truncate_string_field_longer_than());
p.SetPrintMessageFieldsInIndexOrder(true);
p.SetExpandAny(true);
p.PrintToString(m, &str);
return absl::StrCat(m.GetTypeName(), " {",
(options.single_line_mode() ? " " : "\n"), str, "}");
Expand Down

0 comments on commit a87efbf

Please sign in to comment.