Lines of Code | 41 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 9.76% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
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
|
|||
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 |
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.