From 8b125344ff794f95207ca0febfb918d87f8b054a Mon Sep 17 00:00:00 2001 From: Yurii Holskyi Date: Thu, 31 Jul 2025 12:46:44 +0200 Subject: [PATCH] fix: correct console logging methods in Logger class and import paths in README --- README.md | 14 +++++++------- src/Logger.ts | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e68ba4e..cb22a84 100644 --- a/README.md +++ b/README.md @@ -14,20 +14,20 @@ There are two actual ways of using async logger. 1. Rely on singleton instance produced by this library, which is configured by environment variables (see Configuration section below) - + In this case as simple as ~~~typescript - import logger from '@imqueue/async-async-logger'; - + import logger from '@imqueue/async-logger'; + serviceOptions.logger = logger; ~~~ 2. Instantiate and configure async logger programmatically: ~~~typescript - import { Logger } from '@imqueue/async-async-logger'; - + import { Logger } from '@imqueue/async-logger'; + const { name, version } = require('./package.json'); - + const logger = new Logger({ transports: [{ type: 'http', @@ -48,7 +48,7 @@ There are two actual ways of using async logger. hostname: 'localhost' }, }); - + serviceOptions.logger = logger; ~~~ diff --git a/src/Logger.ts b/src/Logger.ts index 1c331dc..1bb55ef 100644 --- a/src/Logger.ts +++ b/src/Logger.ts @@ -51,9 +51,9 @@ export class Logger implements ILogger { */ private static readonly console: ILogger = { log: (...args: any[]) => setTimeout(() => console.log(...args)), - info: (...args: any[]) => setTimeout(() => console.log(...args)), - warn: (...args: any[]) => setTimeout(() => console.log(...args)), - error: (...args: any[]) => setTimeout(() => console.log(...args)), + info: (...args: any[]) => setTimeout(() => console.info(...args)), + warn: (...args: any[]) => setTimeout(() => console.warn(...args)), + error: (...args: any[]) => setTimeout(() => console.error(...args)), }; /**