1
0
Fork 0
mirror of synced 2024-06-17 10:04:43 +12:00

Set logging level instead of disabling it in DLManager

This commit is contained in:
loathingKernel 2022-06-26 14:29:20 +03:00
parent 99ab488820
commit 78fb13830e

View file

@ -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: