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 there a way to detect a TTY? #69

Open
sneko opened this issue Oct 12, 2021 · 1 comment
Open

Is there a way to detect a TTY? #69

sneko opened this issue Oct 12, 2021 · 1 comment

Comments

@sneko
Copy link

sneko commented Oct 12, 2021

Hi @mattn ,

I'm using your library to use or not coloration for my logger. It helps me having colors locally, and better syntax for third-party tools to look at logs (in a cluster...).

Your library is great with runtime except when using tests (go test ...). Do you have a solution to detect a real terminal is behind the command?

I can implement on my own something to force during tests by setting an environment variable, but curious to know your thoughts on this 😄

Thank you,

EDIT: some reading constabulary/gb#472

Librairies that can help formatting "test metadata":

@sneko sneko changed the title Is there a way to detect ATTY terminal Is there a way to detect a TTY? Oct 12, 2021
@dolmen
Copy link
Contributor

dolmen commented Mar 22, 2023

What are you trying to do that doesn't work? Please show code.

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

No branches or pull requests

2 participants