diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2022-08-24 11:07:00 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-08-26 13:39:26 +0200 |
| commit | 100fc2d1fd26e01a8fe79f6cf696891891fe5c4d (patch) | |
| tree | e3b7ab3065de80603b244402c2afe6e3b7ac1da3 /gui/src/shared/logging.ts | |
| parent | 1499e2ab919b853e714cb18a323b77db640e0a51 (diff) | |
| download | mullvadvpn-100fc2d1fd26e01a8fe79f6cf696891891fe5c4d.tar.xz mullvadvpn-100fc2d1fd26e01a8fe79f6cf696891891fe5c4d.zip | |
Simplify app quit procedure
Diffstat (limited to 'gui/src/shared/logging.ts')
| -rw-r--r-- | gui/src/shared/logging.ts | 8 |
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 { |
