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)), }; /**