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

Fix colors not appearing in non-tty environments #751

Merged
merged 1 commit into from
Nov 18, 2015

Conversation

fiznool
Copy link
Contributor

@fiznool fiznool commented Nov 9, 2015

Fixes #609, #616, #669

Also maybe fixes #648?

@@ -6,6 +6,9 @@
*
*/

// Fix colors not appearing in non-tty environments
require('colors').enabled = true;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be require('colors/safe').enabled = true to avoid String.prototype modifications. Actually, adding it on line 13 with just colors.enabled = true should be more than enough.

@indexzero
Copy link
Member

We want to try to add test coverage here before merging this.

@fiznool
Copy link
Contributor Author

fiznool commented Nov 18, 2015

@indexzero can I help here? Would really like to get this merged in.

@indexzero
Copy link
Member

@fiznool absolutely. Can you write a test that spins up a process running winston in a non-TTY environment with colors enables and ensure that it works with colorize: true and colorize: false?

@fiznool
Copy link
Contributor Author

fiznool commented Nov 18, 2015

@indexzero I've added test coverage for this and rebased/squashed commits.

@indexzero
Copy link
Member

Awesome work @fiznool!

indexzero added a commit that referenced this pull request Nov 18, 2015
Fix colors not appearing in non-tty environments
@indexzero indexzero merged commit 69c92bb into winstonjs:master Nov 18, 2015
@fiznool
Copy link
Contributor Author

fiznool commented Nov 18, 2015

Thanks for the speedy merge!

@indexzero
Copy link
Member

I'll always make time for anyone who takes the extra time to write tests and contribute to keeping the quality of the project high. Again: well done.

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

Successfully merging this pull request may close these issues.

winston logs colors Level colors do not show up when using foreman since 1.0.0
3 participants