diff --git a/elektronLogging/ElektronFormatter.go b/elektronLogging/ElektronFormatter.go index 97d609e..a0b1ff0 100644 --- a/elektronLogging/ElektronFormatter.go +++ b/elektronLogging/ElektronFormatter.go @@ -2,7 +2,7 @@ package elektronLogging import ( "bytes" - "github.com/fatih/color" + "fmt" "strings" log "github.com/sirupsen/logrus" @@ -12,20 +12,6 @@ type ElektronFormatter struct { TimestampFormat string } -func (f ElektronFormatter) getColor(entry *log.Entry) *color.Color { - switch entry.Level { - case log.InfoLevel: - return color.New(color.FgGreen, color.Bold) - case log.WarnLevel: - return color.New(color.FgYellow, color.Bold) - case log.ErrorLevel: - return color.New(color.FgRed, color.Bold) - case log.FatalLevel: - return color.New(color.FgRed, color.Bold) - default: - return color.New(color.FgWhite, color.Bold) - } -} func (f ElektronFormatter) Format(entry *log.Entry) ([]byte, error) { var b *bytes.Buffer @@ -35,8 +21,7 @@ func (f ElektronFormatter) Format(entry *log.Entry) ([]byte, error) { b = &bytes.Buffer{} } - levelColor := f.getColor(entry) - level := levelColor.Sprintf("[%s]:", strings.ToUpper(entry.Level.String())) + level := fmt.Sprintf("[%s]:", strings.ToUpper(entry.Level.String())) message := strings.Join([]string{level, entry.Time.Format(f.TimestampFormat), entry.Message, " "}, " ") var formattedFields []string