-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
57 lines (42 loc) · 1.38 KB
/
main.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
(function () {
'use strict';
const color = require('colors');
function info() {
var message = [('[INFO]'.cyan)],
args = Array.prototype.slice.call(arguments);
console.log.apply(console, message.concat(args));
}
function success() {
var message = [('[SUCCESS]'.green)],
args = Array.prototype.slice.call(arguments);
console.log.apply(console, message.concat(args));
}
function warning() {
var message = [('[WARNING]'.yellow)],
args = Array.prototype.slice.call(arguments);
console.log.apply(console, message.concat(args));
}
function error() {
var message = [('[ERROR]'.red)],
args = Array.prototype.slice.call(arguments);
console.log.apply(console, message.concat(args));
}
function highlight() {
var arg = Array.prototype.slice.call(arguments)[0].magenta;
console.log.apply(console, [arg]);
}
function customLog(title, color) {
var message = [(title[color])],
args = Array.prototype.slice.call(arguments);
args.splice(0, 2);
console.log.apply(console, message.concat(args));
}
module.exports = {
info: info,
success: success,
warning: warning,
error: error,
customLog: customLog,
highlight: highlight
};
})()