Last active
August 29, 2015 13:56
-
-
Save digilord/8986811 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require('util'); | |
var clc = require('cli-color'); | |
var notice = clc.cyanBright.bold; | |
var error = clc.red.bold; | |
var warn = clc.yellow; | |
// Setup logging functions | |
var inspect = function(message) { | |
util.log(util.inspect(message, {colors:true})) | |
}; | |
var _log = function (message, level) { | |
if(typeof level === 'undefined') | |
level = notice | |
util.log(level(message)); | |
}; | |
var notice = function(message){ | |
_log(message, notice); | |
}; | |
var warn = function(message){ | |
_log(message, warn); | |
}; | |
var error = function(message){ | |
_log(message, error); | |
}; | |
exports.inspect = inspect; | |
exports.notice = notice; | |
exports.warn = warn; | |
exports.error = error; | |
console.log('Loaded') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var log = require("./index"); | |
require('repl').start({useGlobal:true}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment