From cda74ac3b9c01e5d2b8237c476e8df242f06a7b0 Mon Sep 17 00:00:00 2001 From: Krzysztof Maziarz Date: Mon, 11 Sep 2023 20:19:40 +0000 Subject: [PATCH] feat(utils): Make suppress_outputs also disable logging --- syntheseus/reaction_prediction/utils/misc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/syntheseus/reaction_prediction/utils/misc.py b/syntheseus/reaction_prediction/utils/misc.py index ae1a5e67..6172ff3f 100644 --- a/syntheseus/reaction_prediction/utils/misc.py +++ b/syntheseus/reaction_prediction/utils/misc.py @@ -1,3 +1,4 @@ +import logging import multiprocessing import os import random @@ -33,7 +34,9 @@ def suppress_outputs(): """Suppress messages written to both stdout and stderr.""" with open(devnull, "w") as fnull: with redirect_stderr(fnull), redirect_stdout(fnull): + logging.disable(logging.CRITICAL) yield + logging.disable(logging.NOTSET) def dictify(data: Any) -> Any: