diff --git a/freqtrade/util/__init__.py b/freqtrade/util/__init__.py index 50527eb97..3c3c034c1 100644 --- a/freqtrade/util/__init__.py +++ b/freqtrade/util/__init__.py @@ -1,3 +1,2 @@ from freqtrade.util.ft_precise import FtPrecise # noqa: F401 from freqtrade.util.periodic_cache import PeriodicCache # noqa: F401 -from freqtrade.util.rich_progress import FtProgress # noqa: F401 diff --git a/freqtrade/util/rich_progress.py b/freqtrade/util/rich_progress.py deleted file mode 100644 index 7fe00b4d8..000000000 --- a/freqtrade/util/rich_progress.py +++ /dev/null @@ -1,27 +0,0 @@ -import logging -import sys -from contextlib import contextmanager - -from rich.progress import Progress - - -@contextmanager -def FtProgress(*args, **kwargs): - """ - Wrapper around rich.progress.Progress to fix issues with logging. - """ - try: - __logger = kwargs.pop('logger', None) - streamhandlers = [x for x in __logger.root.handlers if type(x) == logging.StreamHandler] - __prior_stderr = [] - - with Progress(*args, **kwargs) as progress: - for handler in streamhandlers: - __prior_stderr.append(handler.stream) - handler.setStream(sys.stderr) - - yield progress - - finally: - for idx, handler in enumerate(streamhandlers): - handler.setStream(__prior_stderr[idx])