Skip to content

Commit

Permalink
feat(utils): Make suppress_outputs also disable logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaziarz committed Sep 11, 2023
1 parent 58a2b51 commit cda74ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions syntheseus/reaction_prediction/utils/misc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import multiprocessing
import os
import random
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit cda74ac

Please sign in to comment.