Try to detect color support, make color configurable

This commit tries to detect if users can render colors in their terminal
and only enables color logs if that is true.

It also adds no-color.org's NO_COLOR env var support to allow it to be
disabled.
This commit is contained in:
Kristoffer Dalby 2021-08-06 07:29:57 +01:00
parent 8a614dabc0
commit 73a00c89ff
3 changed files with 28 additions and 0 deletions

1
go.mod
View file

@ -4,6 +4,7 @@ go 1.16
require (
github.com/AlecAivazis/survey/v2 v2.0.5
github.com/efekarakus/termcolor v1.0.1 // indirect
github.com/gin-gonic/gin v1.7.2
github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b
github.com/klauspost/compress v1.13.1