Notify log subscription only when logger exists
Move logSubscription.notify into the branch that calls this.logger.log and remove the previous external call. This ensures the subscription is notified only when the configured logger is used, avoiding redundant or spurious notifications.
This commit is contained in:
1 parent
2c57faf117
commit
b106d69cd3
1 file changed
+1
-1
@@ -196,8 +196,8 @@ export class LogWrapper implements ILogWrapper {
|
||||
// eslint-disable-next-line no-control-regex
|
||||
this.logger.log(level, message.replace(/\x1B[@-_][0-?]*[ -/]*[@-~]/g, ''));
|
||||
}
|
||||
logSubscription.notify(JSON.stringify({ level, message }));
|
||||
}
|
||||
logSubscription.notify(JSON.stringify({ level, message }));
|
||||
}
|
||||
|
||||
log (...args: any[]) {
|
||||
|
||||
Reference in new issue
Block a user