fix(smartlog): add getSmartlogDestination()

This commit is contained in:
Philipp Kunz 2018-11-04 14:24:12 +01:00
parent 15cfa8fe88
commit b7ee6bb9a6

View File

@ -1,7 +1,7 @@
import * as plugins from './logdna.plugins';
import { LogdnaMessage } from './logdna.classes.logmessage';
import { ILogPackage } from '@pushrocks/smartlog-interfaces';
import { ILogPackage, ILogDestination } from '@pushrocks/smartlog-interfaces';
/**
* the main logdna account
@ -74,4 +74,15 @@ export class LogdnaAccount {
async sendSmartlogPackage (smartlogPackageArg: ILogPackage) {
this.sendLogDnaMessage(LogdnaMessage.fromSmartLogPackage(smartlogPackageArg));
}
/**
* returns a smartlog compatible log destination
*/
async getSmartlogDestination(): Promise<ILogDestination> {
return {
handleLog: (logPackageArg) => {
this.sendSmartlogPackage(logPackageArg)
}
};
}
}