diff options
author | 2017-07-03 11:54:09 -0400 | |
---|---|---|
committer | 2017-07-05 10:57:13 -0400 | |
commit | 97a1db383ccf0e4454a3e4703e0dfb30c20201bf (patch) | |
tree | 8ee6d1ca531f476fe204f27da2bcf9d9c673779d /src/main/java/com/google/devtools/build/lib/buildeventstream | |
parent | 59800128dbaa412a027846fb46bc98a22c2dd132 (diff) |
BEP JSON file: omit unnecessary white space
To keep the build-event JSON file more compact, do not generate
unnecessary white space. This also simplifies navigation through the
file as now we have precisely one JSON object per line.
Change-Id: I385f3f86d32f70c935e406a22234745f1d6e6515
PiperOrigin-RevId: 160832955
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildeventstream')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/buildeventstream/transports/JsonFormatFileTransport.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/JsonFormatFileTransport.java b/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/JsonFormatFileTransport.java index 423ab2932e..e090f55800 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/JsonFormatFileTransport.java +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/JsonFormatFileTransport.java @@ -57,7 +57,11 @@ public final class JsonFormatFileTransport extends FileTransport { }; String protoJsonRepresentation; try { - protoJsonRepresentation = JsonFormat.printer().print(event.asStreamProto(converters)) + "\n"; + protoJsonRepresentation = + JsonFormat.printer() + .omittingInsignificantWhitespace() + .print(event.asStreamProto(converters)) + + "\n"; } catch (InvalidProtocolBufferException e) { // We don't expect any unknown Any fields in our protocol buffer. Nevertheless, handle // the exception gracefully and, at least, return valid JSON with an id field. |