forked from opendatacity/re-data
-
Notifications
You must be signed in to change notification settings - Fork 1
/
log.js
34 lines (32 loc) · 897 Bytes
/
log.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
#!/usr/bin/env node
/* get npm modules */
var colors = require("colors");
module.exports = {
args: function(a) {
var o = []; for (var i = 0; i < a.length; i++) o.push(a[i]); return o;
},
info: function() {
var args = module.exports.args(arguments)
args.unshift("[INFO]".inverse.bold.cyan);
console.error.apply(this, args);
},
warn: function() {
var args = module.exports.args(arguments)
args.unshift("[WARN]".inverse.bold.yellow);
console.error.apply(this, args);
},
error: function() {
var args = module.exports.args(arguments)
args.unshift("[ERR!]".inverse.bold.red);
console.error.apply(this, args);
},
critical: function() {
var args = module.exports.args(arguments)
args.unshift("[CRIT]".inverse.bold.cyan);
console.error.apply(this, args);
process.exit();
},
done: function() {
console.error("<3".magenta.bold, "made with datalove".magenta);
}
};