Skip to content
Snippets Groups Projects
Unverified Commit 7b56fdb9 authored by Tomasz Maczukin's avatar Tomasz Maczukin
Browse files

Restore levelText setting in '--no-color' mode

parent 87e152c0
No related tags found
No related merge requests found
...@@ -51,27 +51,27 @@ func (f *RunnerTextFormatter) printColored(b *bytes.Buffer, entry *logrus.Entry, ...@@ -51,27 +51,27 @@ func (f *RunnerTextFormatter) printColored(b *bytes.Buffer, entry *logrus.Entry,
} }
func (f *RunnerTextFormatter) getLevelColorAndText(level logrus.Level) (lvlColor, lvlText, resetColor string) { func (f *RunnerTextFormatter) getLevelColorAndText(level logrus.Level) (lvlColor, lvlText, resetColor string) {
color := map[logrus.Level]string{
logrus.DebugLevel: helpers.ANSI_BOLD_WHITE,
logrus.WarnLevel: helpers.ANSI_YELLOW,
logrus.ErrorLevel: helpers.ANSI_BOLD_RED,
logrus.FatalLevel: helpers.ANSI_BOLD_RED,
logrus.PanicLevel: helpers.ANSI_BOLD_RED,
}
text := map[logrus.Level]string{ text := map[logrus.Level]string{
logrus.DebugLevel: "",
logrus.WarnLevel: "WARNING: ", logrus.WarnLevel: "WARNING: ",
logrus.ErrorLevel: "ERROR: ", logrus.ErrorLevel: "ERROR: ",
logrus.FatalLevel: "FATAL: ", logrus.FatalLevel: "FATAL: ",
logrus.PanicLevel: "PANIC: ", logrus.PanicLevel: "PANIC: ",
} }
lvlText = text[level]
if f.DisableColors == true && f.ForceColors != true { if f.DisableColors == true && f.ForceColors != true {
return return
} }
lvlText = text[level] color := map[logrus.Level]string{
logrus.DebugLevel: helpers.ANSI_BOLD_WHITE,
logrus.WarnLevel: helpers.ANSI_YELLOW,
logrus.ErrorLevel: helpers.ANSI_BOLD_RED,
logrus.FatalLevel: helpers.ANSI_BOLD_RED,
logrus.PanicLevel: helpers.ANSI_BOLD_RED,
}
lvlColor = color[level] lvlColor = color[level]
resetColor = helpers.ANSI_RESET resetColor = helpers.ANSI_RESET
return return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment