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

feat(logger): add FORCE_COLOR environment variable support #1003

Merged
merged 5 commits into from
Feb 17, 2023

Conversation

automation-stack
Copy link
Contributor

@automation-stack automation-stack commented Feb 7, 2023

Motivation

  • We now all use CI-solutions and many of them supports terminal colors in browser (logs, web-terminal and others)
  • All CI processes are no-tty and can't pass check isatty.IsTerminal (fatih/color forces nocolor for all CI jobs with condition !isatty.IsTerminal(os.Stdout.Fd()))
  • CI jobs without colored logs extremely inconvenient for debugging and evaluating results

Now, we can force colored output with FORCE_COLOR environment variable and ignore all shortsighted restrictions and efficiently use the awesome go-task/task in CI jobs.

Why PR suggested to go-task/task?

Maintainer of fatih/color rejected PR with FORCE_COLOR support with unconvincing arguments

@automation-stack automation-stack changed the title feat(logger): added FORCE_COLOR environment variable support feat(logger): add FORCE_COLOR environment variable support Feb 7, 2023
internal/logger/logger.go Outdated Show resolved Hide resolved
@automation-stack
Copy link
Contributor Author

automation-stack commented Feb 13, 2023

@andreynering

Also, can you add an entry to the CHANGELOG and the API page on the documentation?

Done.

@andreynering
Copy link
Member

Thanks @automation-stack!

@andreynering andreynering merged commit 9af056e into go-task:master Feb 17, 2023
@pd93 pd93 mentioned this pull request Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants