mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Don't panic if log parameters are invalid
This commit is contained in:
parent
763a3ef267
commit
92ba658606
1 changed files with 6 additions and 2 deletions
|
@ -168,8 +168,12 @@ func addFields(logger *logrus.Entry, keyValuePairs []interface{}) *logrus.Entry
|
||||||
case error:
|
case error:
|
||||||
logger = logger.WithField("error", name.Error())
|
logger = logger.WithField("error", name.Error())
|
||||||
case string:
|
case string:
|
||||||
value := keyValuePairs[i+1]
|
if i+1 >= len(keyValuePairs) {
|
||||||
logger = logger.WithField(name, value)
|
logger = logger.WithField(name, "!!!!Invalid number of arguments in log call!!!!")
|
||||||
|
} else {
|
||||||
|
value := keyValuePairs[i+1]
|
||||||
|
logger = logger.WithField(name, value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return logger
|
return logger
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue