Add log.removeHandler function

This commit is contained in:
Nick O'Leary
2016-10-20 23:31:40 +01:00
parent bd391963bc
commit 5f0cab8cc2
2 changed files with 72 additions and 1 deletions

View File

@@ -114,6 +114,12 @@ var log = module.exports = {
addHandler: function(func) {
logHandlers.push(func);
},
removeHandler: function(func) {
var index = logHandlers.indexOf(func);
if (index > -1) {
logHandlers.splice(index,1);
}
},
log: function(msg) {
msg.timestamp = Date.now();
logHandlers.forEach(function(handler) {