disable --stats by default

This commit is contained in:
palto42 2020-01-18 14:38:59 +01:00
parent e27ba0d08a
commit e108526bab
2 changed files with 6 additions and 13 deletions

View file

@ -187,13 +187,7 @@ def create_archive(
+ (('--info',) if logger.getEffectiveLevel() == logging.INFO and not json else ()) + (('--info',) if logger.getEffectiveLevel() == logging.INFO and not json else ())
+ ( + (
('--stats',) ('--stats',)
if not dry_run if not dry_run and (logger.isEnabledFor(logging.DEBUG) or stats) and not json
and (
(logger.isEnabledFor(logging.INFO) and files)
or logger.isEnabledFor(logging.DEBUG)
or stats
)
and not json
else () else ()
) )
+ (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) and not json else ()) + (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) and not json else ())
@ -217,7 +211,7 @@ def create_archive(
if json: if json:
output_log_level = None output_log_level = None
elif stats: elif stats and logger.getEffectiveLevel() == logging.WARNING:
output_log_level = logging.WARNING output_log_level = logging.WARNING
else: else:
output_log_level = logging.INFO output_log_level = logging.INFO

View file

@ -60,10 +60,7 @@ def prune_archives(
+ (('--lock-wait', str(lock_wait)) if lock_wait else ()) + (('--lock-wait', str(lock_wait)) if lock_wait else ())
+ ( + (
('--stats',) ('--stats',)
if not dry_run if not dry_run and logger.getEffectiveLevel() == logging.DEBUG or stats
and (logger.isEnabledFor(logging.INFO) and files)
or logger.getEffectiveLevel() == logging.DEBUG
or stats
else () else ()
) )
+ (('--info',) if logger.getEffectiveLevel() == logging.INFO else ()) + (('--info',) if logger.getEffectiveLevel() == logging.INFO else ())
@ -76,6 +73,8 @@ def prune_archives(
execute_command( execute_command(
full_command, full_command,
output_log_level=logging.WARNING if stats else logging.INFO, output_log_level=logging.WARNING
if (stats and logger.getEffectiveLevel() == logging.WARNING)
else logging.INFO,
error_on_warnings=False, error_on_warnings=False,
) )