Add --stats-log-level so can see --stats without -v - fixes #1180

The most common use for this flag is likely to be showing the stats
without using -v by using `--stats-log-level NOTICE`.
This commit is contained in:
Nick Craig-Wood 2017-06-26 22:46:45 +01:00
parent 33f302a06b
commit aa20486485
5 changed files with 54 additions and 18 deletions

View file

@ -253,7 +253,7 @@ func Run(Retry bool, showStats bool, cmd *cobra.Command, f func() error) {
log.Fatalf("Failed to %s: %v", cmd.Name(), err)
}
if showStats && (fs.Stats.Errored() || *statsInterval > 0) {
fs.Infof(nil, "%s", fs.Stats)
fs.Stats.Log()
}
fs.Debugf(nil, "Go routines at exit %d\n", runtime.NumGoroutine())
if fs.Stats.Errored() {