From b7ee6bb9a6aa72d0c8ebedb4cb922f94ea509dd2 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sun, 4 Nov 2018 14:24:12 +0100 Subject: [PATCH] fix(smartlog): add getSmartlogDestination() --- ts/logdna.logdnaaccount.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ts/logdna.logdnaaccount.ts b/ts/logdna.logdnaaccount.ts index 93ffea6..b0491cd 100644 --- a/ts/logdna.logdnaaccount.ts +++ b/ts/logdna.logdnaaccount.ts @@ -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 { + return { + handleLog: (logPackageArg) => { + this.sendSmartlogPackage(logPackageArg) + } + }; + } }