-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlogger.js
35 lines (33 loc) · 999 Bytes
/
logger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var logger = {
log: function () {
arguments[0] = arguments[0].bgBlack;
console.log.apply(null, arguments);
},
green: function () {
arguments[0] = arguments[0].green;
this.log.apply(this, arguments);
},
red: function () {
arguments[0] = arguments[0].red;
this.log.apply(this, arguments);
},
blue: function () {
arguments[0] = arguments[0].blue;
this.log.apply(this, arguments);
},
info: function () {
arguments[0] = "INFO: ".bold.blue + arguments[0];
this.log.apply(this, arguments);
},
warn: function () {
arguments[0] = "WARNING: ".bold.yellow + arguments[0];
arguments[0] = arguments[0].blackBG;
console.warn.apply(null, arguments);
},
error: function () {
arguments[0] = "ERROR: ".bold.red + arguments[0];
arguments[0] = arguments[0].blackBG;
console.error.apply(null, arguments);
}
};
module.exports = logger;