public
Created

  • Download Gist
gistfile1.js
JavaScript
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
var frinerva = require('./frinerva');
// .....
} else if (nconf.get('i')) {
frinerva.inform(nconf.get('i'));
}
 
///.....
 
function display() {
console.log.apply(this, arguments);
}
 
function inform(id) {
load(function (err, data) {
var log = JSON.parse(data.toString()),
size = log.length,
i = 0,
entry = null;
 
for (i = 0; i < size; i += 1) {
entry = log[i];
if ((entry.cmd === 'info') && entry.id && (entry.id == id.toLowerCase())) {
display('[%s][%s]: %s',
entry.id,
entry.cmd,
entry.msg ? entry.msg : '');
}
}
});
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.