1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-03 17:13:18 +00:00

Redo log level flags

* -vv or --log-level DEBUG
  * -v or --log-level INFO
  * --log-level NOTICE (default)
  * -q --log-level ERROR

Replace Config.Verbose and Config.Quiet with Config.LogLevel

Fixes #739 Fixes #1108 Fixes #1000
This commit is contained in:
Nick Craig-Wood
2017-02-09 21:22:46 +00:00
parent 0366ea39c5
commit ac1c041377
9 changed files with 137 additions and 40 deletions

View File

@@ -274,12 +274,10 @@ func Run(Retry bool, showStats bool, cmd *cobra.Command, f func() error) {
if err != nil {
log.Fatalf("Failed to %s: %v", cmd.Name(), err)
}
if showStats && (!fs.Config.Quiet || fs.Stats.Errored() || *statsInterval > 0) {
if showStats && (fs.Stats.Errored() || *statsInterval > 0) {
fs.Infof(nil, "%s", fs.Stats)
}
if fs.Config.Verbose {
fs.Debugf(nil, "Go routines at exit %d\n", runtime.NumGoroutine())
}
fs.Debugf(nil, "Go routines at exit %d\n", runtime.NumGoroutine())
if fs.Stats.Errored() {
os.Exit(1)
}