1 | "use strict"; |
||
2 | |||
3 | const winston = require('winston'); |
||
4 | const WinstonLogger = winston.Logger; |
||
5 | const ConsoleTransport = winston.transports.Console; |
||
6 | const Logger = require('./Logger'); |
||
7 | |||
8 | const globalLogger = new WinstonLogger({ |
||
9 | transports: [ |
||
10 | new ConsoleTransport({ |
||
11 | level: 'debug', |
||
12 | colorize: true, |
||
13 | json: false |
||
14 | }) |
||
15 | ] |
||
16 | }); |
||
17 | |||
18 | /** |
||
19 | * Logger for a speaking stuff |
||
20 | */ |
||
21 | class SpeakerLogger extends Logger { |
||
22 | constructor(name) { |
||
23 | super(globalLogger); |
||
24 | |||
25 | this.name = name; |
||
26 | } |
||
27 | |||
28 | normalizeMessage(message, meta) { |
||
0 ignored issues
–
show
|
|||
29 | return `${this.name} says "${message}"`; |
||
30 | } |
||
31 | } |
||
32 | |||
33 | module.exports = SpeakerLogger; |
||
34 |
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.