diff --git a/conda_build/utils.py b/conda_build/utils.py index e5e8d9c8c2..997349df5b 100644 --- a/conda_build/utils.py +++ b/conda_build/utils.py @@ -1653,7 +1653,8 @@ def get_logger(name, level=logging.INFO, dedupe=True, add_stdout_stderr_handlers logging.config.dictConfig(config_dict) level = config_dict.get("loggers", {}).get(name, {}).get("level", level) log = logging.getLogger(name) - log.setLevel(level) + if log.level != level: + log.setLevel(level) if dedupe: log.addFilter(dedupe_filter) diff --git a/news/5384-test-log-level b/news/5384-test-log-level new file mode 100644 index 0000000000..69d1682488 --- /dev/null +++ b/news/5384-test-log-level @@ -0,0 +1,3 @@ +### Enhancements + +* Reduced performance overheads of logging. (#5384)