Skip to content

Commit a2b5776

Browse files
committed
fix: only log env variables when debugging logging (#234)
1 parent 2a9c20c commit a2b5776

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
Only log environment variables in debug logging.

riot/riot.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -825,12 +825,19 @@ def run(
825825
cmdargs=(" ".join(f"'{arg}'" for arg in cmdargs))
826826
).strip()
827827
env_str = "\n".join(f"{k}={v}" for k, v in env.items())
828-
logger.info(
829-
"Running command '%s' in venv '%s' with environment:\n%s.",
830-
command,
831-
venv_path,
832-
env_str,
833-
)
828+
if logger.isEnabledFor(logging.DEBUG):
829+
logger.debug(
830+
"Running command '%s' in venv '%s' with environment:\n%s.",
831+
command,
832+
venv_path,
833+
env_str,
834+
)
835+
else:
836+
logger.info(
837+
"Running command '%s' in venv '%s'.",
838+
command,
839+
venv_path,
840+
)
834841
with nspkgs(inst):
835842
try:
836843
output = self.run_cmd_venv(

0 commit comments

Comments
 (0)