mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-04-04 13:47:36 +03:00
Allow multiple log-level-overrides
on the same field
This commit is contained in:
parent
dd6462de13
commit
0af3e29ce1
4 changed files with 34 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue