From 78fb13830e3a18ab857553cd19d626d28cf354a3 Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Sun, 26 Jun 2022 14:29:20 +0300 Subject: [PATCH] Set logging level instead of disabling it in DLManager --- rare/lgndr/manager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rare/lgndr/manager.py b/rare/lgndr/manager.py index a444b951..d50bf48e 100644 --- a/rare/lgndr/manager.py +++ b/rare/lgndr/manager.py @@ -120,7 +120,9 @@ class DLManager(DLManagerReal): hours = minutes = seconds = 0 rt_hours = rt_minutes = rt_seconds = 0 - logging.disable(logging.INFO) # lk: Disable INFO logging channel for the segment below + log_level = self.log.level + # lk: Disable up to INFO logging level for the segment below + self.log.setLevel(logging.ERROR) self.log.info(f'= Progress: {perc:.02f}% ({processed_chunks}/{num_chunk_tasks}), ' f'Running for {rt_hours:02d}:{rt_minutes:02d}:{rt_seconds:02d}, ' f'ETA: {hours:02d}:{minutes:02d}:{seconds:02d}') @@ -131,7 +133,8 @@ class DLManager(DLManagerReal): f'/ {dl_unc_speed / 1024 / 1024:.02f} MiB/s (decompressed)') self.log.info(f' + Disk\t- {w_speed / 1024 / 1024:.02f} MiB/s (write) / ' f'{r_speed / 1024 / 1024:.02f} MiB/s (read)') - logging.disable(logging.NOTSET) # lk: Enable INFO logging channel again + # lk: Restore previous logging level + self.log.setLevel(log_level) # send status update to back to instantiator (if queue exists) if self.status_queue: