Skip to content

Commit c92f959

Browse files
committed
f
1 parent 14913c7 commit c92f959

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Logger.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ declare global {
77
var __ONE_LOGGER_INSTANCES__: Map<string, ILogger>;
88
}
99

10-
globalThis.__ONE_LOGGER_INSTANCES__ = new Map<string, ILogger>();
10+
// make sure we have a global logger instances map
11+
if (!globalThis.__ONE_LOGGER_INSTANCES__) {
12+
globalThis.__ONE_LOGGER_INSTANCES__ = new Map<string, ILogger>();
13+
}
1114

1215
export interface LoggerOptions {
1316
loggerName: string;

0 commit comments

Comments
 (0)