Skip to content

Loading…

Return formatted text from formatters #31

Closed
wants to merge 1 commit into from

2 participants

@contra

This makes it easier to log to more places than the console but keep the pretty colors. Now you can do stream.write(debug("shiiiii"))

@tj
Sloth member
tj commented

not sure what this would be for, it's just supposed to output to stdio

@tj tj closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 13, 2012
  1. @contra

    return formatted text

    contra committed
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/debug.js
View
2 lib/debug.js
@@ -118,12 +118,14 @@ function debug(name) {
+ ' +' + humanize(ms) + '\033[0m';
console.error.apply(this, arguments);
+ return fmt;
}
function plain(fmt) {
fmt = new Date().toUTCString()
+ ' ' + name + ' ' + fmt;
console.error.apply(this, arguments);
+ return fmt;
}
colored.enabled = plain.enabled = true;
Something went wrong with that request. Please try again.