AriaMinaei / pretty-error

See node.js errors with less clutter
MIT License
1.52k stars 49 forks source link

Add a way to disable colors #20

Closed Kikobeats closed 9 years ago

Kikobeats commented 9 years ago

Under production, you normally store your logs into files. if the output is colored then the result is a unreadable output line with ansi codes inside.

Could be great disable colors automatically using the env variable process.env.NODE_END === 'production' or add a param like {colors: true} in the .render and .start method or in the constructor.

Also related with #16.

AriaMinaei commented 9 years ago

I added this change: https://github.com/AriaMinaei/pretty-error/commit/e644d1cb340a355ae60e94c790210e839b698280. You can use it like this:

pe.withoutColors();

After that, all renders will be done without colors. Let me know if this helps, so I can bump the version.

Kikobeats commented 9 years ago

I like it!

AriaMinaei commented 9 years ago

Okay, 1.2.0 is out. Thanks for the suggestion :)