mirror of
https://github.com/rclone/rclone.git
synced 2025-12-16 00:04:40 +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:
committed by
Nick Craig-Wood
parent
88b0757288
commit
bcdfad3c83
@@ -7,7 +7,6 @@ import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"mime"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -86,7 +85,7 @@ func newServer(ctx context.Context, opt *rc.Options, mux *http.ServeMux) (*Serve
|
||||
if opt.Auth.BasicPass == "" && opt.Auth.HtPasswd == "" {
|
||||
randomPass, err := random.Password(128)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to make password: %v", err)
|
||||
fs.Fatalf(nil, "Failed to make password: %v", err)
|
||||
}
|
||||
opt.Auth.BasicPass = randomPass
|
||||
fs.Infof(nil, "No password specified. Using random password: %s \n", randomPass)
|
||||
|
||||
Reference in New Issue
Block a user