Created
May 3, 2012 12:42
-
-
Save framlin/2585378 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 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 : ''); | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment