From ffa1b1a258fddc243e5344705606f4ed5d1430bb Mon Sep 17 00:00:00 2001 From: Ivan Andreev Date: Sat, 2 Oct 2021 12:50:11 +0300 Subject: [PATCH] config: enable verbose logging by the --verbose argument - #5594 --- fs/config.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/config.go b/fs/config.go index 3a4de7717..5a4e44c71 100644 --- a/fs/config.go +++ b/fs/config.go @@ -4,6 +4,7 @@ import ( "context" "net" "os" + "strconv" "strings" "time" @@ -179,6 +180,11 @@ func NewConfig() *ConfigInfo { if arg == "--log-level=DEBUG" || (arg == "--log-level" && len(os.Args) > argIndex+1 && os.Args[argIndex+1] == "DEBUG") { c.LogLevel = LogLevelDebug } + if strings.HasPrefix(arg, "--verbose=") { + if level, err := strconv.Atoi(arg[10:]); err == nil && level >= 2 { + c.LogLevel = LogLevelDebug + } + } } envValue, found := os.LookupEnv("RCLONE_LOG_LEVEL") if found && envValue == "DEBUG" {