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

Add support for NO_COLOR environment variable #1650

Merged
merged 2 commits into from Aug 14, 2021

Conversation

krisztianb
Copy link
Contributor

Closes #1619

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Aug 13, 2021

I'd like to avoid introducing new properties, instead just adding the process.env check to the logger file when creating prefixes. Introducing a new property increases the API surface with no immediate benefit that I see

@krisztianb
Copy link
Contributor Author

krisztianb commented Aug 14, 2021

Updated. Are you ok with making the property private? I think it makes sense not to query the environment variables each time a message is logged.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Aug 14, 2021

Yeah, I'm good with this.

I was thinking of doing:

const messagePrefixes = "NO_COLOR" in process.env ? { ... } : { ... }

@Gerrit0 Gerrit0 merged commit 0df9e6c into TypeStrong:master Aug 14, 2021
@krisztianb krisztianb deleted the feat/1619-no-color branch August 14, 2021 15:02
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.

Add support for NO_COLOR environment variable
2 participants