baryon / tracer

A powerful and customizable logging library for node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not compatible with node.js's console

tangxinfa opened this issue · comments

Node.js 's console:

console.log
    Prints to stdout with newline
console.info
    Same as console.log.
console.error
    Same as console.log but prints to stderr.
console.warn
    Same as console.error.

Tracer's console:

transport : function(data) {
    console.log(data.output);
}

This mean's when use tracer, all logging output write to stdout, we can't split message in shell now:

node app.js > ./app.out.log 2>./app.err.log

Buyan's no problem:

ConsoleRawStream.prototype.write = function (rec) {
   if (rec.level < INFO) {
       console.log(rec);
   } else if (rec.level < WARN) {
       console.info(rec);
   } else if (rec.level < ERROR) {
       console.warn(rec);
  } else {
       console.error(rec);
   }
 }; 

This is a dealbreaker!