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; -};