mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 04:27:37 +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:
|
||||
logger = logger.WithField("error", name.Error())
|
||||
case string:
|
||||
value := keyValuePairs[i+1]
|
||||
logger = logger.WithField(name, value)
|
||||
if i+1 >= len(keyValuePairs) {
|
||||
logger = logger.WithField(name, "!!!!Invalid number of arguments in log call!!!!")
|
||||
} else {
|
||||
value := keyValuePairs[i+1]
|
||||
logger = logger.WithField(name, value)
|
||||
}
|
||||
}
|
||||
}
|
||||
return logger
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue