summaryrefslogtreecommitdiffhomepage
path: root/gui/src/shared/logging.ts
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-08-26 13:39:37 +0200
committerOskar Nyberg <oskar@mullvad.net>2022-08-26 13:39:37 +0200
commit31574ee101c21ef03d3b413bf7b404c2764f83fa (patch)
treea66b0a8184ad7035521edb16a473863ad9aa5906 /gui/src/shared/logging.ts
parent1499e2ab919b853e714cb18a323b77db640e0a51 (diff)
parentf3763868ee7a39b9518db8380ea112da0ae013e9 (diff)
downloadmullvadvpn-31574ee101c21ef03d3b413bf7b404c2764f83fa.tar.xz
mullvadvpn-31574ee101c21ef03d3b413bf7b404c2764f83fa.zip
Merge branch 'fix-crash-on-exit-on-linux'
Diffstat (limited to 'gui/src/shared/logging.ts')
-rw-r--r--gui/src/shared/logging.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/gui/src/shared/logging.ts b/gui/src/shared/logging.ts
index 77d0168701..c2537e00d4 100644
--- a/gui/src/shared/logging.ts
+++ b/gui/src/shared/logging.ts
@@ -25,8 +25,12 @@ export class Logger {
public verbose = (...data: unknown[]) => this.log(LogLevel.verbose, ...data);
public debug = (...data: unknown[]) => this.log(LogLevel.debug, ...data);
- public dispose() {
- this.outputs.forEach((output) => output.dispose?.());
+ public disposeDisposableOutputs() {
+ // Keep the outputs that aren't disposable to continue to forward log messages to them.
+ this.outputs = this.outputs.filter((output) => {
+ output.dispose?.();
+ return output.dispose === undefined;
+ });
}
private getDateString(): string {