summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarian Beermann <public@enkore.de>2016-08-21 17:35:00 +0200
committerMarian Beermann <public@enkore.de>2016-08-21 19:57:36 +0200
commite7d44cec39ae96229ce36e20fe81ef281691aea8 (patch)
tree3bb0f28ead597897f78fcc06ed9e1c7113d788d3 /src
parent4d214e2503bc28f4b75b89288935f8fecf7cda4e (diff)
extract: --progress: Calculating size
Diffstat (limited to 'src')
-rw-r--r--src/borg/archiver.py2
-rw-r--r--src/borg/helpers.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/borg/archiver.py b/src/borg/archiver.py
index 417f055ee..6c46daf68 100644
--- a/src/borg/archiver.py
+++ b/src/borg/archiver.py
@@ -456,6 +456,8 @@ class Archiver:
filter = self.build_filter(matcher, item_is_hardlink_master, strip_components)
if progress:
+ progress_logger = logging.getLogger(ProgressIndicatorPercent.LOGGER)
+ progress_logger.info('Calculating size')
extracted_size = sum(item.file_size() for item in archive.iter_items(filter))
pi = ProgressIndicatorPercent(total=extracted_size, msg='Extracting files %5.1f%%', step=0.1)
else:
diff --git a/src/borg/helpers.py b/src/borg/helpers.py
index 72f03ac67..c9d99ef97 100644
--- a/src/borg/helpers.py
+++ b/src/borg/helpers.py
@@ -1105,6 +1105,8 @@ def yes(msg=None, false_msg=None, true_msg=None, default_msg=None,
class ProgressIndicatorPercent:
+ LOGGER = 'borg.output.progress'
+
def __init__(self, total, step=5, start=0, same_line=True, msg="%3.0f%%"):
"""
Percentage-based progress indicator
@@ -1122,7 +1124,7 @@ class ProgressIndicatorPercent:
self.msg = msg
self.same_line = same_line
self.handler = None
- self.logger = logging.getLogger('borg.output.progress')
+ self.logger = logging.getLogger(self.LOGGER)
# If there are no handlers, set one up explicitly because the
# terminator and propagation needs to be set. If there are,