Skip to content

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
@happy5214
Copy link

I'm not sure if anyone will see this, but with this feature now supported, can someone add TypeDoc to the list at https://github.com/jcs/no_color? I looked there to see if TypeDoc had NO_COLOR support, and I ended up having to dig through the code to figure that out.

@phoneticallySAARTHaK
Copy link
Contributor

@happy5214 I believe you can do that yourself? They have direction for the same

https://github.com/jcs/no_color?tab=readme-ov-file#adding-software

@happy5214
Copy link

@happy5214 I believe you can do that yourself? They have direction for the same

https://github.com/jcs/no_color?tab=readme-ov-file#adding-software

I considered doing it myself, but as someone who just started using TypeDoc today, I didn't want to possibly misrepresent the description or presuppose that TypeDoc's omission was a simple oversight rather than an intentional decision. I just don't know. If anything, I thought I'd ask least seek the permission of a project of which I'm not a contributor or long-time user before adding it to that list.

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

4 participants