fix(logger): do not output WARN level logs for non-root modules#3760
Merged
aignas merged 6 commits intobazel-contrib:mainfrom May 10, 2026
Merged
fix(logger): do not output WARN level logs for non-root modules#3760aignas merged 6 commits intobazel-contrib:mainfrom
aignas merged 6 commits intobazel-contrib:mainfrom
Conversation
A user has reported issues which actually resulted from a particular `bazel` version being used and once he updated, the issues disappeared because of changes in implicit non-root module dependencies. In order to reduce the warning spam of non-root modules, set the default level to `ERROR` for non-root module parsing context and `WARN` for root module context. This means that the users will not get console output that they have no way to fix without patching upstream dependencies. At the same time ensure that the name of the module is printed together with the logs to better understand where something is coming from. Fixes bazel-contrib#3749
Contributor
There was a problem hiding this comment.
Code Review
This pull request reduces the default log verbosity for non-root modules in Bzlmod by passing the module context to the logger. Review feedback identifies that the verbosity mapping in repo_utils.bzl must be updated to include ERROR and WARN levels to effectively silence warnings for non-root modules. Additionally, it is recommended to pass the module context to the global logger in python.bzl to ensure consistent behavior across the extension.
rickeylev
approved these changes
May 8, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
aignas
commented
May 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A user has reported issues which actually resulted from a particular
bazelversion being used and once he updated, the issues disappearedbecause of changes in implicit non-root module dependencies.
In order to reduce the warning spam of non-root modules, set the default
level to
ERRORfor non-root module parsing context andWARNfor rootmodule context. This means that the users will not get console output
that they have no way to fix without patching upstream dependencies.
At the same time ensure that the name of the module is printed together
with the logs to better understand where something is coming from.
Fixes #3749