From a84ead8e7c0adaefde6c32b4e6449a523c3ca94a Mon Sep 17 00:00:00 2001 From: Manu Date: Sun, 7 Feb 2021 10:42:46 +0800 Subject: [PATCH] Pass args.log_json to FilesystemObjectProcessors/Statistics instance --- src/borg/archive.py | 5 +++-- src/borg/archiver.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/borg/archive.py b/src/borg/archive.py index c0e2fe0f5..ab9de1d18 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -1200,7 +1200,8 @@ class FilesystemObjectProcessors: def __init__(self, *, metadata_collector, cache, key, add_item, process_file_chunks, - chunker_params, show_progress, sparse): + chunker_params, show_progress, sparse, + log_json): self.metadata_collector = metadata_collector self.cache = cache self.key = key @@ -1209,7 +1210,7 @@ def __init__(self, *, metadata_collector, cache, key, self.show_progress = show_progress self.hard_links = {} - self.stats = Statistics() # threading: done by cache (including progress) + self.stats = Statistics(output_json=log_json) # threading: done by cache (including progress) self.cwd = os.getcwd() self.chunker = get_chunker(*chunker_params, seed=key.chunk_seed, sparse=sparse) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index dfdffc7d7..3cefb36f4 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -657,7 +657,8 @@ def create_inner(archive, cache, fso): checkpoint_interval=args.checkpoint_interval, rechunkify=False) fso = FilesystemObjectProcessors(metadata_collector=metadata_collector, cache=cache, key=key, process_file_chunks=cp.process_file_chunks, add_item=archive.add_item, - chunker_params=args.chunker_params, show_progress=args.progress, sparse=args.sparse) + chunker_params=args.chunker_params, show_progress=args.progress, sparse=args.sparse, + log_json=args.log_json) create_inner(archive, cache, fso) else: create_inner(None, None, None)