1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-15 15:53:41 +00: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:
albertony
2024-08-18 16:58:35 +02:00
committed by Nick Craig-Wood
parent 88b0757288
commit bcdfad3c83
64 changed files with 333 additions and 357 deletions

View File

@@ -3,7 +3,6 @@ package mountlib
import (
"context"
"errors"
"log"
"sort"
"sync"
"time"
@@ -123,12 +122,12 @@ func mountRc(ctx context.Context, in rc.Params) (out rc.Params, err error) {
mnt := NewMountPoint(mountFn, mountPoint, fdst, &mountOpt, &vfsOpt)
_, err = mnt.Mount()
if err != nil {
log.Printf("mount FAILED: %v", err)
fs.Logf(nil, "mount FAILED: %v", err)
return nil, err
}
go func() {
if err = mnt.Wait(); err != nil {
log.Printf("unmount FAILED: %v", err)
fs.Logf(nil, "unmount FAILED: %v", err)
return
}
mountMu.Lock()