From 6ae400c2ddd16d019121eddcb6eda605dff3c831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Thu, 15 Oct 2015 21:20:58 -0400 Subject: [PATCH] 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 --- borg/archiver.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/borg/archiver.py b/borg/archiver.py index 729a2deb1..738e92139 100644 --- a/borg/archiver.py +++ b/borg/archiver.py @@ -56,6 +56,9 @@ class Archiver: 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 @@ Type "Yes I am sure" if you understand this and want to continue.\n""") 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 @@ Type "Yes I am sure" if you understand this and want to continue.\n""") 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"""