Skip to content

Commit

Permalink
perf: only set level if needed (#5384)
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr authored Jun 25, 2024
1 parent 3a09f13 commit c7a1e9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conda_build/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions news/5384-test-log-level
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Enhancements

* Reduced performance overheads of logging. (#5384)

0 comments on commit c7a1e9b

Please sign in to comment.