Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Jan 1, 2025
1 parent 14913c7 commit c92f959
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ declare global {
var __ONE_LOGGER_INSTANCES__: Map<string, ILogger>;
}

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

export interface LoggerOptions {
loggerName: string;
Expand Down

0 comments on commit c92f959

Please sign in to comment.