move to zerolog

This commit is contained in:
Mikaël Cluseau
2024-01-20 16:41:54 +01:00
parent 5ab8b74041
commit 6bf1d1ccf2
18 changed files with 205 additions and 170 deletions

View File

@ -1,8 +1,9 @@
package main
import (
"log"
"regexp"
"github.com/rs/zerolog/log"
)
func regexpSelectN(n int, regexps []string, names []string) (matches []string) {
@ -16,7 +17,7 @@ func regexpSelectN(n int, regexps []string, names []string) (matches []string) {
for _, reStr := range regexps {
re, err := regexp.Compile(reStr)
if err != nil {
log.Printf("warning: invalid regexp ignored: %q: %v", reStr, err)
log.Warn().Err(err).Str("regexp", reStr).Msg("invalid regexp, ignored")
continue
}
res = append(res, re)