Skip to content

Commit 2200c30

Browse files
authored
Merge pull request #91 from xlc/fix-depth-issue
Fix: Prevent Console Re-Patching and Handle Disabling on Configure
2 parents f38e4ec + a379b72 commit 2200c30

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,16 @@ class FileLoggerStatic {
7070

7171
if (captureConsole) {
7272
this.enableConsoleCapture();
73+
} else {
74+
this.disableConsoleCapture();
7375
}
7476
}
7577

7678
enableConsoleCapture() {
79+
if (this._originalConsole) {
80+
return;
81+
}
82+
7783
// Store original console methods
7884
this._originalConsole = {
7985
debug: console.debug,

0 commit comments

Comments
 (0)