Windows escape sequence fix
Our logger wasn't entirely compatible with Windows escape sequences when not in TTY mode. This fix changes the stderr to one that automatically transforms the escape sequences to some Windows compatible ones. Signed-off-by: guillaume <guillaume.derouville@gmail.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/mattn/go-colorable"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/spf13/viper"
|
||||
"golang.org/x/term"
|
||||
@@ -22,7 +23,7 @@ func New() zerolog.Logger {
|
||||
Logger()
|
||||
|
||||
if !jsonLogs() {
|
||||
logger = logger.Output(&PlainOutput{Out: os.Stderr})
|
||||
logger = logger.Output(&PlainOutput{Out: colorable.NewColorableStderr()})
|
||||
} else {
|
||||
logger = logger.With().Timestamp().Caller().Logger()
|
||||
}
|
||||
|
Reference in New Issue
Block a user