diff --git a/packages/ssi-types/__tests__/logging.test.ts b/packages/ssi-types/__tests__/logging.test.ts index 9b0d750d2..3a04a41cc 100644 --- a/packages/ssi-types/__tests__/logging.test.ts +++ b/packages/ssi-types/__tests__/logging.test.ts @@ -1,6 +1,13 @@ -import { Loggers, LogMethod } from '../src' +import {Loggers, LogMethod} from '../src' describe('Simple logging', () => { + + it('Should be able to log without providing options for a new namespace', () => { + Loggers.DEFAULT.get(''+ Date.now()) + .log('Random test') + }) + + it('Should perform a debug package log', () => { Loggers.DEFAULT.options('debug_pkg', { methods: [LogMethod.DEBUG_PKG] }) .get('debug_pkg') diff --git a/packages/ssi-types/src/logging/index.ts b/packages/ssi-types/src/logging/index.ts index 961b265e6..8f9007b36 100644 --- a/packages/ssi-types/src/logging/index.ts +++ b/packages/ssi-types/src/logging/index.ts @@ -46,8 +46,8 @@ export function logOptions(opts?: SimpleLogOptions): Required } export class Loggers { - public static readonly DEFAULT: Loggers = new Loggers({ defaultLogLevel: LogLevel.INFO, methods: [LogMethod.DEBUG_PKG, LogMethod.EVENT] }) private static readonly DEFAULT_KEY = '__DEFAULT__' + public static readonly DEFAULT: Loggers = new Loggers({ defaultLogLevel: LogLevel.INFO, methods: [LogMethod.DEBUG_PKG, LogMethod.EVENT] }) private readonly namespaceOptions: Map> = new Map() private readonly loggers: WeakMap, ISimpleLogger> = new WeakMap()