Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -48,7 +48,7 @@ There are two actual ways of using async logger.
hostname: 'localhost'
},
});

serviceOptions.logger = logger;
~~~

Expand Down
6 changes: 3 additions & 3 deletions src/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
};

/**
Expand Down