1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 09:47:58 +00:00

factor out status output so it is consistent

as it was, surrogates were not always removed, for example

we may also want to output at different levels or control if we want
to print unchanged files and so on
This commit is contained in:
Antoine Beaupré 2015-10-15 21:20:58 -04:00
parent b120e5f119
commit d8f8076984

View file

@ -56,6 +56,9 @@ def print_verbose(self, msg, *args, **kw):
msg = args and msg % args or msg
logger.info(msg)
def print_status(self, status, path):
logger.info("%1s %s", status, remove_surrogates(path))
def do_serve(self, args):
"""Start in server mode. This command is usually not used manually.
"""
@ -143,7 +146,7 @@ def do_create(self, args):
self.print_error('%s: %s', path, e)
else:
status = '-'
self.print_verbose("%1s %s", status, path)
self.print_status(status, path)
continue
path = os.path.normpath(path)
if args.dontcross:
@ -238,7 +241,7 @@ def _process(self, archive, cache, excludes, exclude_caches, skip_inodes, path,
status = '-' # dry run, item was not backed up
# output ALL the stuff - it can be easily filtered using grep.
# even stuff considered unchanged might be interesting.
self.print_verbose("%1s %s", status, remove_surrogates(path))
self.print_status(status, path)
def do_extract(self, args):
"""Extract archive contents"""