mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 04:27:37 +03:00
Rename log.LevelCritical to log.LevelFatal
This commit is contained in:
parent
28389fb05e
commit
5943e8f953
26 changed files with 40 additions and 46 deletions
18
log/log.go
18
log/log.go
|
@ -41,12 +41,12 @@ var redacted = &Hook{
|
|||
}
|
||||
|
||||
const (
|
||||
LevelCritical = Level(logrus.FatalLevel) // TODO Rename to LevelFatal
|
||||
LevelError = Level(logrus.ErrorLevel)
|
||||
LevelWarn = Level(logrus.WarnLevel)
|
||||
LevelInfo = Level(logrus.InfoLevel)
|
||||
LevelDebug = Level(logrus.DebugLevel)
|
||||
LevelTrace = Level(logrus.TraceLevel)
|
||||
LevelFatal = Level(logrus.FatalLevel)
|
||||
LevelError = Level(logrus.ErrorLevel)
|
||||
LevelWarn = Level(logrus.WarnLevel)
|
||||
LevelInfo = Level(logrus.InfoLevel)
|
||||
LevelDebug = Level(logrus.DebugLevel)
|
||||
LevelTrace = Level(logrus.TraceLevel)
|
||||
)
|
||||
|
||||
type contextKey string
|
||||
|
@ -82,8 +82,8 @@ func levelFromString(l string) Level {
|
|||
envLevel := strings.ToLower(l)
|
||||
var level Level
|
||||
switch envLevel {
|
||||
case "critical":
|
||||
level = LevelCritical
|
||||
case "fatal":
|
||||
level = LevelFatal
|
||||
case "error":
|
||||
level = LevelError
|
||||
case "warn":
|
||||
|
@ -147,7 +147,7 @@ func CurrentLevel() Level {
|
|||
}
|
||||
|
||||
func Fatal(args ...interface{}) {
|
||||
log(LevelCritical, args...)
|
||||
log(LevelFatal, args...)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
|
|
@ -167,9 +167,9 @@ var _ = Describe("Logger", func() {
|
|||
})
|
||||
|
||||
Describe("SetLevelString", func() {
|
||||
It("converts Critical level", func() {
|
||||
SetLevelString("Critical")
|
||||
Expect(CurrentLevel()).To(Equal(LevelCritical))
|
||||
It("converts Fatal level", func() {
|
||||
SetLevelString("Fatal")
|
||||
Expect(CurrentLevel()).To(Equal(LevelFatal))
|
||||
})
|
||||
It("converts Error level", func() {
|
||||
SetLevelString("ERROR")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue