Failed Conditions
Push — master ( f5e7b3...711045 )
by Yo
01:30
created

lib/logger/SpeakerLogger.js   A

Size

Lines of Code 33

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
nc 1
dl 0
loc 33
rs 10
noi 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A SpeakerLogger.js ➔ ??? 0 5 1
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
Unused Code introduced by
The parameter meta is not used and could be removed.

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.

Loading history...
29
        return `${this.name} says "${message}"`;
30
    }
31
}
32
33
module.exports = SpeakerLogger;
34