Omit "last: []" from debug trace json if less than 10 event logged.
Reduces the boilerplate from the json produced without any information loss. PiperOrigin-RevId: 633540269
This commit is contained in:
parent
55b9c391e8
commit
e17b3d7f83
@ -459,11 +459,15 @@ public final class DebugTraceUtil {
|
|||||||
for (EventLog eventLog : firstLogs) {
|
for (EventLog eventLog : firstLogs) {
|
||||||
jsonWriter.value(eventLog.toString());
|
jsonWriter.value(eventLog.toString());
|
||||||
}
|
}
|
||||||
jsonWriter.endArray().name("last").beginArray();
|
jsonWriter.endArray();
|
||||||
|
if (!lastLogs.isEmpty()) {
|
||||||
|
jsonWriter.name("last").beginArray();
|
||||||
for (EventLog eventLog : lastLogs) {
|
for (EventLog eventLog : lastLogs) {
|
||||||
jsonWriter.value(eventLog.toString());
|
jsonWriter.value(eventLog.toString());
|
||||||
}
|
}
|
||||||
jsonWriter.endArray().endObject();
|
jsonWriter.endArray();
|
||||||
|
}
|
||||||
|
jsonWriter.endObject();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user