From c503ac5e1a97274786c23f1c7c970c780f61b26c Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Fri, 10 Nov 2023 12:38:14 +0100 Subject: [PATCH] Fix conda_index.index verbose DEBUG/INFO logging Signed-off-by: Marcel Bargull --- 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..c889eedf07 --- /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 + +### Deprecations + +* + +### Docs + +* + +### Other + +*