Skip to content

Commit

Permalink
fix(layered-storage): sort debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomaash committed Dec 27, 2019
1 parent f3f3746 commit e25f252
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/layered-storage/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,10 @@ export class LayeredStorageCore<
public dumpContent(): void {
console.groupCollapsed("Storage content dump");

const layers = [...this._layers.values()];

console.log("Time:", new Date());
console.log("Layers:", [...this._layers.values()]);
console.log("Layers:", layers);
console.log("Segments:", [...this._segments.values()]);

console.groupCollapsed("Cache");
Expand All @@ -551,11 +553,12 @@ export class LayeredStorageCore<
console.groupEnd();

console.groupCollapsed("Data");
for (const [layer, lData] of this._data.entries()) {
for (const layer of layers) {
const lData = this._data.get(layer)!;
console.groupCollapsed(`Layer: ${layer}`);
for (const [segment, segmentData] of lData.entries()) {
console.groupCollapsed(`Segment: ${String(segment)}`);
for (const [key, value] of segmentData.entries()) {
for (const [key, value] of [...segmentData.entries()].sort()) {
console.log([key, value]);
}
console.groupEnd();
Expand Down

0 comments on commit e25f252

Please sign in to comment.