Skip to content

Commit 3e3c511

Browse files
chore: add logging to LocalHistory for storage init
1 parent 9075729 commit 3e3c511

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/sds/src/message_channel/mem_local_history.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Logger } from "@waku/utils";
12
import _ from "lodash";
23

34
import { type ChannelId, ContentMessage, isContentMessage } from "./message.js";
@@ -53,6 +54,8 @@ export type MemLocalHistoryOptions = {
5354
maxSize?: number;
5455
};
5556

57+
const log = new Logger("sds:local-history");
58+
5659
export class MemLocalHistory implements ILocalHistory {
5760
private items: ContentMessage[] = [];
5861
private readonly storage?: PersistentStorage;
@@ -70,10 +73,13 @@ export class MemLocalHistory implements ILocalHistory {
7073
this.maxSize = maxSize ?? DEFAULT_MAX_LENGTH;
7174
if (storage instanceof PersistentStorage) {
7275
this.storage = storage;
76+
log.info("Using explicit persistent storage");
7377
} else if (typeof storage === "string") {
7478
this.storage = PersistentStorage.create(storage);
79+
log.info("Creating persistent storage for channel", storage);
7580
} else {
7681
this.storage = undefined;
82+
log.info("Using in-memory storage");
7783
}
7884

7985
this.load();

0 commit comments

Comments
 (0)