You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
478 B
29 lines
478 B
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func main() {
|
|
|
|
|
|
|
|
filters := logs.NewFilters()
|
|
|
|
|
|
filters.AddFilterAllowed(logs.NewFilter("1",func(e *logs.Entry) bool {
|
|
fmt.Println("UNO FILTER")
|
|
return e.Level.Has(logs.LevelWarn)
|
|
}))
|
|
|
|
|
|
filters.AddFilterAllowed(logs.NewFilter("2",func(e *logs.Entry) bool {
|
|
fmt.Println("DS FILTER")
|
|
return e.Level.Has(logs.LevelDebug)
|
|
}))
|
|
|
|
|
|
fmt.Printf("Pasado %v\n",filters.Filter(logs.NewEntry(nil,logs.LevelWarn.Add(logs.LevelDebug),"",nil)))
|
|
|
|
}
|