From eb5ecc0368c0cdfd26356648402721e2d333389e Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Fri, 17 Nov 2023 21:18:37 +0100 Subject: [PATCH] Fix conda_index.index verbose DEBUG/INFO logging (#5066) Signed-off-by: Marcel Bargull Co-authored-by: Ken Odegard --- conda_build/index.py | 28 +++++++++++++++------------- news/5066-fix-conda_index-log-spam | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 news/5066-fix-conda_index-log-spam diff --git a/conda_build/index.py b/conda_build/index.py index 690673f0c9..c80fd12a31 100644 --- a/conda_build/index.py +++ b/conda_build/index.py @@ -312,19 +312,21 @@ def _delegated_update_index( dir_path = parent_path subdirs = [dirname] - return _update_index( - dir_path, - check_md5=check_md5, - channel_name=channel_name, - patch_generator=patch_generator, - threads=threads, - verbose=verbose, - progress=progress, - subdirs=subdirs, - warn=warn, - current_index_versions=current_index_versions, - debug=debug, - ) + log_level = logging.DEBUG if debug else logging.INFO if verbose else logging.WARNING + with utils.LoggingContext(log_level): + return _update_index( + dir_path, + check_md5=check_md5, + channel_name=channel_name, + patch_generator=patch_generator, + threads=threads, + verbose=verbose, + progress=progress, + subdirs=subdirs, + warn=warn, + current_index_versions=current_index_versions, + debug=debug, + ) # Everything below is deprecated to maintain API/feature compatibility. diff --git a/news/5066-fix-conda_index-log-spam b/news/5066-fix-conda_index-log-spam new file mode 100644 index 0000000000..aceb93cc2a --- /dev/null +++ b/news/5066-fix-conda_index-log-spam @@ -0,0 +1,19 @@ +### Enhancements + +* + +### Bug fixes + +* Fix conda_index.index verbose DEBUG/INFO message logging. (#5066) + +### Deprecations + +* + +### Docs + +* + +### Other + +*