From 4fd4de20c29baea8149dea6dfcbde48d5debdf7c Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Tue, 10 Jul 2018 22:34:33 +0200 Subject: [PATCH] BREAKING CHANGE(core): now has simple defaultLogger --- test/test.ts | 2 +- ts/index.ts | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/test/test.ts b/test/test.ts index c22cae2..5b20280 100644 --- a/test/test.ts +++ b/test/test.ts @@ -4,7 +4,7 @@ import * as smartlog from '../ts/index'; let defaultLogger: smartlog.Smartlog; tap.test('should produce instance of Smartlog', async () => { - defaultLogger = smartlog.getDefaultLogger(); + defaultLogger = smartlog.defaultLogger; expect(defaultLogger).to.be.instanceOf(smartlog.Smartlog); }); diff --git a/ts/index.ts b/ts/index.ts index eecd1ff..f296cf0 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -1,13 +1,6 @@ import * as plugins from './smartlog.plugins'; import { Smartlog } from './smartlog.classes.smartlog'; +const defaultLogger: Smartlog = new Smartlog(); -export { Smartlog }; +export { Smartlog, defaultLogger }; -let defaultLogger: Smartlog; - -export const getDefaultLogger = () => { - if (!defaultLogger) { - defaultLogger = new Smartlog(); - } - return defaultLogger; -};