mirror of
https://github.com/rclone/rclone.git
synced 2025-11-23 21:44:49 +02:00
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:
committed by
Nick Craig-Wood
parent
88b0757288
commit
bcdfad3c83
@@ -4,12 +4,12 @@ package main
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"math/rand"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/lib/encoder"
|
||||
)
|
||||
|
||||
@@ -434,13 +434,13 @@ var testCasesDoubleEdge = []testCase{
|
||||
|
||||
func fatal(err error, s ...interface{}) {
|
||||
if err != nil {
|
||||
log.Fatalln(append(s, err))
|
||||
fs.Fatal(nil, fmt.Sprint(append(s, err)))
|
||||
}
|
||||
}
|
||||
func fatalW(_ int, err error) func(...interface{}) {
|
||||
if err != nil {
|
||||
return func(s ...interface{}) {
|
||||
log.Fatalln(append(s, err))
|
||||
fs.Fatal(nil, fmt.Sprint(append(s, err)))
|
||||
}
|
||||
}
|
||||
return func(s ...interface{}) {}
|
||||
|
||||
Reference in New Issue
Block a user