Notify log subscription only when logger exists
Release NapCat / validate-version (push) Canceled after 0s
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s

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:
手瓜一十雪 committed 2026-03-06 10:48:03 +08:00
1 parent 2c57faf117
commit 7380665cc2
1 file changed
+1 -1
+1 -1
View File
@@ -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[]) {