1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-31 03:31:41 +00:00

silence borg by default

this also prints file status on stderr directly, bypassing the logger
as we do with other topical flags (like progress and status)
This commit is contained in:
Antoine Beaupré 2015-11-23 12:38:11 -05:00
parent 9899eaf241
commit 8d3d1c22d6
2 changed files with 6 additions and 6 deletions

View file

@ -75,7 +75,7 @@ def print_warning(self, msg, *args):
def print_file_status(self, status, path):
if self.args.changed:
logger.info("%1s %s" % (status, remove_surrogates(path)))
print("%1s %s" % (status, remove_surrogates(path)), file=sys.stderr)
def do_serve(self, args):
"""Start in server mode. This command is usually not used manually.
@ -663,9 +663,9 @@ def preprocess_args(self, args):
def build_parser(self, args=None, prog=None):
common_parser = argparse.ArgumentParser(add_help=False, prog=prog)
common_parser.add_argument('-v', '--verbose', dest='log_level',
action='store_const', const='info', default='info',
action='store_const', const='info', default='warning',
help='verbose output, same as --log-level=info')
common_parser.add_argument('--log-level', dest='log_level', default='info', metavar='LEVEL',
common_parser.add_argument('--log-level', dest='log_level', default='warning', metavar='LEVEL',
choices=('debug', 'info', 'warning', 'error', 'critical'),
help='set the log level to LEVEL, default: %(default)s)')
common_parser.add_argument('--lock-wait', dest='lock_wait', type=int, metavar='N', default=1,

View file

@ -947,13 +947,13 @@ def open_archive(self, name):
return archive, repository
def test_check_usage(self):
output = self.cmd('check', self.repository_location, exit_code=0)
output = self.cmd('check', '--log-level=info', self.repository_location, exit_code=0)
self.assert_in('Starting repository check', output)
self.assert_in('Starting archive consistency check', output)
output = self.cmd('check', '--repository-only', self.repository_location, exit_code=0)
output = self.cmd('check', '--log-level=info', '--repository-only', self.repository_location, exit_code=0)
self.assert_in('Starting repository check', output)
self.assert_not_in('Starting archive consistency check', output)
output = self.cmd('check', '--archives-only', self.repository_location, exit_code=0)
output = self.cmd('check', '--log-level=info', '--archives-only', self.repository_location, exit_code=0)
self.assert_not_in('Starting repository check', output)
self.assert_in('Starting archive consistency check', output)