Fix infinite recursion on unknown Level.String()

Using `%q` in the error string causes `MarshalText` to recurse (by calling String()).
This commit is contained in:
noushavandijk
2019-02-20 18:22:53 +01:00
committed by Richard Poirier
parent cdb2f3857c
commit 4f5fd631f1
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ func (level Level) MarshalText() ([]byte, error) {
return []byte("panic"), nil
}
return nil, fmt.Errorf("not a valid lorus level %q", level)
return nil, fmt.Errorf("not a valid logrus level %d", level)
}
// A constant exposing all logging levels