Fixing some problems with the adapter API
This commit is contained in:
14
src/types.ts
14
src/types.ts
@ -107,13 +107,19 @@ export interface Message {
|
||||
}
|
||||
|
||||
export interface Adapter {
|
||||
init(
|
||||
observable: ObservableInterface<Message>,
|
||||
name?: string
|
||||
): void | Promise<void>;
|
||||
/**
|
||||
* This function initialises the Adapter. It might be called multiple times, when added to multiple instances
|
||||
* @param observable An observable to subscribe to messages
|
||||
*/
|
||||
init(observable: ObservableInterface<Message>): void | Promise<void>;
|
||||
|
||||
flush(sync: true): void;
|
||||
flush(sync: false): void | Promise<void>;
|
||||
|
||||
/**
|
||||
* When a close function is available, it will be called when no logging instance references it anymore.
|
||||
*
|
||||
* WARNING: The adapter might be reinitialised, when it is added to a new Logging instance
|
||||
*/
|
||||
close?(): void;
|
||||
}
|
||||
|
Reference in New Issue
Block a user