Closed intervalia closed 8 years ago
I would like to have a way to get TRUE raw console output.
I want console.error, console.info, console.warn and console.log to all just become a pass through.
console.error
console.info
console.warn
console.log
You are close with log where you do this:
log
this.log = function log(key, proc, string) { var self = this; if(self.raw) { logger.log(string); return; } ...
But with info and error you add color coding like this:
info
error
this.info = function info(key, proc, string) { var stamp = (new Date().toLocaleTimeString()) + " " + key; logger.log(proc.color(this.pad(stamp,this.padding)), colors.cyan(string)); }; this.error = function error(key, proc, string) { var stamp = (new Date().toLocaleTimeString()) + " " + key; logger.error(proc.color(this.pad(stamp,this.padding)), colors.red(string)); };
It would be nice if nothing was done to the output and that everything would not get redirected to console.log. Maybe like this:
this.info = function info(key, proc, string) { if(this.raw) { logger.info(string); } else { var stamp = (new Date().toLocaleTimeString()) + " " + key; logger.log(proc.color(this.pad(stamp,this.padding)), colors.cyan(string)); } }; this.error = function error(key, proc, string) { if(this.raw) { logger.error(string); } else { var stamp = (new Date().toLocaleTimeString()) + " " + key; logger.error(proc.color(this.pad(stamp,this.padding)), colors.red(string)); } };
This is not the issue I thought it was. The issue is really that there is not true sync mechanism between stdout and stderr. I will enter a different issue for that.
I would like to have a way to get TRUE raw console output.
I want
console.error
,console.info
,console.warn
andconsole.log
to all just become a pass through.You are close with
log
where you do this:But with
info
anderror
you add color coding like this:It would be nice if nothing was done to the output and that everything would not get redirected to
console.log
. Maybe like this: