mirror of
https://github.com/samsonjs/media.git
synced 2026-04-07 11:35:46 +00:00
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
1 changed files with 8 additions and 4 deletions
|
|
@ -459,11 +459,15 @@ public final class DebugTraceUtil {
|
|||
for (EventLog eventLog : firstLogs) {
|
||||
jsonWriter.value(eventLog.toString());
|
||||
}
|
||||
jsonWriter.endArray().name("last").beginArray();
|
||||
for (EventLog eventLog : lastLogs) {
|
||||
jsonWriter.value(eventLog.toString());
|
||||
jsonWriter.endArray();
|
||||
if (!lastLogs.isEmpty()) {
|
||||
jsonWriter.name("last").beginArray();
|
||||
for (EventLog eventLog : lastLogs) {
|
||||
jsonWriter.value(eventLog.toString());
|
||||
}
|
||||
jsonWriter.endArray();
|
||||
}
|
||||
jsonWriter.endArray().endObject();
|
||||
jsonWriter.endObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue