File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -14,20 +14,20 @@ There are two actual ways of using async logger.
14
14
15
15
1 . Rely on singleton instance produced by this library, which is configured by
16
16
environment variables (see Configuration section below)
17
-
17
+
18
18
In this case as simple as
19
19
~~~ typescript
20
- import logger from ' @imqueue/async-async- logger' ;
21
-
20
+ import logger from ' @imqueue/async-logger' ;
21
+
22
22
serviceOptions .logger = logger ;
23
23
~~~
24
24
25
25
2 . Instantiate and configure async logger programmatically:
26
26
~~~ typescript
27
- import { Logger } from ' @imqueue/async-async- logger' ;
28
-
27
+ import { Logger } from ' @imqueue/async-logger' ;
28
+
29
29
const { name, version } = require (' ./package.json' );
30
-
30
+
31
31
const logger = new Logger ({
32
32
transports: [{
33
33
type: ' http' ,
@@ -48,7 +48,7 @@ There are two actual ways of using async logger.
48
48
hostname: ' localhost'
49
49
},
50
50
});
51
-
51
+
52
52
serviceOptions .logger = logger ;
53
53
~~~
54
54
Original file line number Diff line number Diff line change @@ -51,9 +51,9 @@ export class Logger implements ILogger {
51
51
*/
52
52
private static readonly console : ILogger = {
53
53
log : ( ...args : any [ ] ) => setTimeout ( ( ) => console . log ( ...args ) ) ,
54
- info : ( ...args : any [ ] ) => setTimeout ( ( ) => console . log ( ...args ) ) ,
55
- warn : ( ...args : any [ ] ) => setTimeout ( ( ) => console . log ( ...args ) ) ,
56
- error : ( ...args : any [ ] ) => setTimeout ( ( ) => console . log ( ...args ) ) ,
54
+ info : ( ...args : any [ ] ) => setTimeout ( ( ) => console . info ( ...args ) ) ,
55
+ warn : ( ...args : any [ ] ) => setTimeout ( ( ) => console . warn ( ...args ) ) ,
56
+ error : ( ...args : any [ ] ) => setTimeout ( ( ) => console . error ( ...args ) ) ,
57
57
} ;
58
58
59
59
/**
You can’t perform that action at this time.
0 commit comments