fix(core): update
This commit is contained in:
@ -1,21 +1,19 @@
|
||||
import * as plugins from './smartlog.plugins.js';
|
||||
|
||||
import { ILogDestination, ILogPackage } from '@pushrocks/smartlog-interfaces';
|
||||
|
||||
export class LogRouter {
|
||||
/**
|
||||
* all log destinations
|
||||
*/
|
||||
private logDestinations: ILogDestination[] = [];
|
||||
private logDestinations: plugins.smartlogInterfaces.ILogDestination[] = [];
|
||||
|
||||
constructor() {}
|
||||
|
||||
public addLogDestination(logDestination: ILogDestination) {
|
||||
public addLogDestination(logDestination: plugins.smartlogInterfaces.ILogDestination) {
|
||||
this.logDestinations.push(logDestination);
|
||||
}
|
||||
|
||||
// routes the log according to added logDestinations
|
||||
public async routeLog(logPackageArg: ILogPackage) {
|
||||
public async routeLog(logPackageArg: plugins.smartlogInterfaces.ILogPackage) {
|
||||
for (const logDestination of this.logDestinations) {
|
||||
await logDestination.handleLog(logPackageArg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user