serialize logs as json

This commit is contained in:
Bruno Windels 2021-02-16 15:08:08 +01:00
parent 4defbe1322
commit 48569c28bc

View file

@ -105,7 +105,7 @@ export class IDBLogger extends BaseLogger {
this._itemCounter += 1;
this._queuedItems.push({
id: `${encodeUint64(serializedItem.s)}:${this._itemCounter}`,
tree: serializedItem
json: JSON.stringify(serializedItem)
});
}
@ -192,7 +192,7 @@ class IDBLogExport {
asBlob() {
const log = {
version: 1,
items: this._items
items: this._items.map(i => JSON.parse(i.json))
};
const json = JSON.stringify(log);
const buffer = this._platform.encoding.utf8.encode(json);