mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 08:23:47 +01:00
config: enable verbose logging by the --verbose argument - #5594
This commit is contained in:
parent
8b8a943dd8
commit
ffa1b1a258
@ -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" {
|
||||
|
Loading…
Reference in New Issue
Block a user