Adding close function to Logging to free resources
This commit is contained in:
@ -39,7 +39,7 @@ export class LoggingBase {
|
||||
|
||||
private messageObservable = new Observable<Message>();
|
||||
protected _name: string;
|
||||
|
||||
|
||||
get name() {
|
||||
return this._name;
|
||||
}
|
||||
@ -88,6 +88,10 @@ export class LoggingBase {
|
||||
}
|
||||
}
|
||||
|
||||
public close() {
|
||||
this.adapter.forEach(adapter => adapter.close ? adapter.close() : undefined);
|
||||
}
|
||||
|
||||
public waitForSetup() {
|
||||
return Promise.all(this.adapter_init);
|
||||
}
|
||||
|
@ -114,4 +114,7 @@ export interface Adapter {
|
||||
|
||||
flush(sync: true): void;
|
||||
flush(sync: false): void | Promise<void>;
|
||||
|
||||
|
||||
close?(): void;
|
||||
}
|
Reference in New Issue
Block a user