Test Failed
Pull Request — master (#2)
by Yo
01:40
created

lib/logger/taskLogger.js   A

Size

Lines of Code 41

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 9.76%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
nc 1
dl 0
loc 41
rs 10
ccs 4
cts 41
cp 0.0976
noi 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A taskLogger.js ➔ ??? 0 5 1
1
"use strict";
2
3 1
const wrapper = require('./wrapper');
4 1
const BaseLogger = require('./EnhancedLogger');
5
6
class TaskLogger extends BaseLogger {
7
8
    constructor(taskName, wrapper) {
9
        super(wrapper);
10
11 2
        this.taskName = taskName;
12
    }
13
14
    starting() {
15
        this.info(' Starting ...');
16
    }
17
18
    stopping() {
19
        this.info(' Stopping ...');
20
    }
21
22
    started() {
23
        this.info(' Started');
24
    }
25
26
    stopped() {
27
        this.info(' Stopped');
28
    }
29
30
    /**
31
     * @inheritDoc
32
     */
33
    normalizeMessage(message, meta = {}) {
1 ignored issue
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...
34
        return `[${this.taskName}]${message}`;
35
    }
36
}
37
38
/**
39
 * @return {TaskLogger} Logger for a task
40
 */
41 1
module.exports = taskName => new TaskLogger(taskName, wrapper);
42
43