diff --git a/src/__tests__/utils/simple-logger.ts b/src/__tests__/utils/simple-logger.ts index a630ee0f..39171739 100644 --- a/src/__tests__/utils/simple-logger.ts +++ b/src/__tests__/utils/simple-logger.ts @@ -71,15 +71,17 @@ describe('logger', () => { switch (env) { case false: - logger = conf.level === undefined ? new SimpleLogger() : new SimpleLogger({ level: conf.level }); + logger = conf.level === undefined + ? new SimpleLogger({ showLevel: false, showTimestamp: false }) + : new SimpleLogger({ level: conf.level, showLevel: false, showTimestamp: false }); break; case true: process.env.LOG_LEVEL = conf.level; - logger = new SimpleLogger(); + logger = new SimpleLogger({ showLevel: false, showTimestamp: false }); break; default: process.env[env] = conf.level; - logger = new SimpleLogger({ envKey: env }); + logger = new SimpleLogger({ envKey: env, showLevel: false, showTimestamp: false }); delete process.env[env]; } @@ -110,7 +112,7 @@ describe('logger', () => { } it('different parameters of log method', () => { - const logger = new SimpleLogger(); + const logger = new SimpleLogger({ showLevel: false, showTimestamp: false }); const a = { b: { diff --git a/src/utils/simple-logger.ts b/src/utils/simple-logger.ts index 40984c16..e0242aff 100644 --- a/src/utils/simple-logger.ts +++ b/src/utils/simple-logger.ts @@ -100,8 +100,8 @@ export class SimpleLogger implements SimpleLogger.Logger { } = options; if (prefix) this.prefix = prefix; - this.showTimestamp = showTimestamp ?? false; - this.showLevel = showLevel ?? false; + this.showTimestamp = showTimestamp ?? true; + this.showLevel = showLevel ?? true; const envKey = options.envKey ?? DEFAULT_ENV_KEY; const envLevel = process.env[envKey];