Skip to content

Commit

Permalink
fix(logger): flush logs when an error/fatal log level occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Apr 12, 2023
1 parent 2ccd368 commit 60838eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/di/src/domain/ContextLogger.ts
Expand Up @@ -124,7 +124,7 @@ export class ContextLogger {
this.stack.push({level: levelStr, data: obj});
}

if (this.maxStackSize < this.stack.length) {
if (this.maxStackSize < this.stack.length || [levels().FATAL, levels().ERROR].includes(level)) {
this.flush();
}
}
Expand Down

0 comments on commit 60838eb

Please sign in to comment.