From 14d771029fbf1c4386fffcb8d62f4c58376a3383 Mon Sep 17 00:00:00 2001 From: Stephen Roller Date: Wed, 19 May 2021 18:52:31 -0400 Subject: [PATCH] [logging] Fix suppression of debug logs --- parlai/core/params.py | 1 - parlai/core/script.py | 1 + parlai/utils/logging.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parlai/core/params.py b/parlai/core/params.py index fd9c4de89a8..6465df14f6b 100644 --- a/parlai/core/params.py +++ b/parlai/core/params.py @@ -1155,7 +1155,6 @@ def parse_args(self, args=None, namespace=None, **kwargs): self._process_args_to_opts(args) print_announcements(self.opt) - logging.set_log_level(self.opt.get('loglevel', 'info').upper()) assert '_subparser' not in self.opt diff --git a/parlai/core/script.py b/parlai/core/script.py index 19adaa24166..a2d654de561 100644 --- a/parlai/core/script.py +++ b/parlai/core/script.py @@ -102,6 +102,7 @@ def _run_args(cls, args: Optional[List[str]] = None): @classmethod def _run_from_parser_and_opt(cls, opt: Opt, parser: ParlaiParser): + logging.set_log_level(opt.get('loglevel', 'info').upper()) script = cls(opt) script.parser = parser return script.run() diff --git a/parlai/utils/logging.py b/parlai/utils/logging.py index 7c2ef10618f..ec65d846295 100644 --- a/parlai/utils/logging.py +++ b/parlai/utils/logging.py @@ -133,7 +133,7 @@ def unmute(self): # ----------------------------------- # Forming the logger # # ----------------------------------- -logger = ParlaiLogger(name=__name__) +logger = ParlaiLogger(name="parlai") def set_log_level(level):