Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is console.error essential? #14

Closed
RandomEtc opened this issue Feb 28, 2012 · 4 comments
Closed

is console.error essential? #14

RandomEtc opened this issue Feb 28, 2012 · 4 comments

Comments

@RandomEtc
Copy link

I'm using another library that uses log4js which already overrides console.error and adds color formatting and timestamps for errors/warnings. This means all my debug output is red and prefixed with [ERROR].

Is there a way that if debug is imported first it can save an un-monkey-patched version of console.error so it can continue to do synchronous logging... or even to allow a choice of log or error in case people don't want sync logging in debug?

@tj
Copy link
Contributor

tj commented Feb 28, 2012

i guess it could, but that's kinda odd to replace the console methods

@RandomEtc
Copy link
Author

Agreed. I'll go complain to the library that uses log4js first :)

@tj
Copy link
Contributor

tj commented Feb 28, 2012

I get that they're maybe trying to unify logging for node by patching it, but most libs leave out console.log etc anyway so they might as well just do var console = require('log4js')

@RandomEtc
Copy link
Author

Definitely - there's no need to monkey patch it when you can just override the variable locally whenever you need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants