Skip to content

Commit 3a2390d

Browse files
committed
twewak
1 parent 5dbf0e8 commit 3a2390d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/verifier/logging_setup.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ func getLoggerAndWriter(logPath string) (*logger.Logger, io.Writer) {
3737
consoleWriter := zerolog.ConsoleWriter{
3838
Out: writer,
3939
TimeFormat: timeFormat,
40-
NoColor: shouldSuppressColor(rawWriter),
40+
NoColor: !shouldColorize(rawWriter),
4141
}
4242

4343
l := zerolog.New(consoleWriter).With().Timestamp().Logger()
4444
return logger.NewLogger(&l, writer), writer
4545
}
4646

47-
// Returns true unless the writer is a TTY.
48-
func shouldSuppressColor(writer io.Writer) bool {
47+
// Returns true only if the writer is a TTY.
48+
func shouldColorize(writer io.Writer) bool {
4949
osFile, isOsFile := writer.(*os.File)
5050
if !isOsFile {
5151
return true
5252
}
5353

54-
return !term.IsTerminal(int(osFile.Fd()))
54+
return term.IsTerminal(int(osFile.Fd()))
5555
}

0 commit comments

Comments
 (0)