We don't need to write if-else condition and log errors. uok do for us.
It is carry function arguments and if it is not null, than dump error to console.
var log =require('tracer').console({format:"{{file}}:{{line}}: {{message}}"}).log;
var ok =require('lib/ok')(log);
functionlog(data,cb){
fs.writeFile('log', data, cb);
}
log('hello',ok(function(){
console.log('ok');
}));
Example 2
uok create method ok in prototype all functions and it allows minimize code
var log =require('tracer').console({format:"{{file}}:{{line}}: {{message}}"}).log;