From 5ec00da4660605b68f5ef160d98009e8322a9b92 Mon Sep 17 00:00:00 2001 From: Matt Mackay Date: Sat, 5 Apr 2025 07:28:08 -0400 Subject: [PATCH 1/2] fix: allow warn logging to be disabled via RULES_PYTHON_REPO_DEBUG_VERBOSITY --- CHANGELOG.md | 1 + python/private/repo_utils.bzl | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbcf2561c8..c6a6dfdb6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,7 @@ Unreleased changes template. * (toolchains) Do not try to run `chmod` when downloading non-windows hermetic toolchain repositories on Windows. Fixes [#2660](https://github.com/bazel-contrib/rules_python/issues/2660). +* (logging) Allow repo rule logging level to be set to `FAIL` via the `RULES_PYTHON_REPO_DEBUG_VERBOSITY` environment variable. {#v0-0-0-added} ### Added diff --git a/python/private/repo_utils.bzl b/python/private/repo_utils.bzl index d9ad2449f1..73883a9244 100644 --- a/python/private/repo_utils.bzl +++ b/python/private/repo_utils.bzl @@ -56,6 +56,7 @@ def _logger(mrctx, name = None): verbosity = { "DEBUG": 2, + "FAIL": -1, "INFO": 1, "TRACE": 3, }.get(verbosity_level, 0) From 2b0b56495f1661097ec3e71ee0df41b336fd6c92 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Sat, 5 Apr 2025 22:12:04 +0900 Subject: [PATCH 2/2] add the value to docs --- docs/environment-variables.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/environment-variables.md b/docs/environment-variables.md index d8735cb2d5..9500fa8295 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -101,6 +101,7 @@ doing. This is mostly useful for development to debug errors. Determines the verbosity of logging output for repo rules. Valid values: * `DEBUG` +* `FAIL` * `INFO` * `TRACE` :::