Allow multiple log-level-overrides on the same field

This commit is contained in:
binwiederhier 2023-02-27 11:03:21 -05:00
parent dd6462de13
commit 0af3e29ce1
4 changed files with 34 additions and 7 deletions

View file

@ -210,11 +210,13 @@ func (e *Event) globalLevelWithOverride() Level {
if e.fields == nil {
return l
}
for field, override := range ov {
for field, fieldOverrides := range ov {
value, exists := e.fields[field]
if exists {
if override.value == "" || override.value == value || override.value == fmt.Sprintf("%v", value) {
return override.level
for _, o := range fieldOverrides {
if o.value == "" || o.value == value || o.value == fmt.Sprintf("%v", value) {
return o.level
}
}
}
}