build: update logging statements to make json log work - fixes #6038

This changes log statements from log to fs package, which is required for --use-json-log
to properly make log output in JSON format. The recently added custom linting rule,
handled by ruleguard via gocritic via golangci-lint, warns about these and suggests
the alternative. Fixing was therefore basically running "golangci-lint run --fix",
although some manual fixup of mainly imports are necessary following that.
This commit is contained in:
albertony
2024-09-06 17:04:18 +01:00
committed by Nick Craig-Wood
parent 88b0757288
commit bcdfad3c83
64 changed files with 333 additions and 357 deletions
+2 -3
View File
@@ -3,7 +3,6 @@ package cmd
import (
"context"
"fmt"
"log"
"os"
"regexp"
"sort"
@@ -76,7 +75,7 @@ var helpFlags = &cobra.Command{
if len(args) > 0 {
re, err := filter.GlobStringToRegexp(args[0], false, true)
if err != nil {
log.Fatalf("Invalid flag filter: %v", err)
fs.Fatalf(nil, "Invalid flag filter: %v", err)
}
fs.Debugf(nil, "Flag filter: %s", re.String())
filterFlagsRe = re
@@ -286,7 +285,7 @@ func quoteString(v interface{}) string {
func showBackend(name string) {
backend, err := fs.Find(name)
if err != nil {
log.Fatal(err)
fs.Fatal(nil, fmt.Sprint(err))
}
var standardOptions, advancedOptions fs.Options
done := map[string]struct{}{}