Skip to content

hide output of module commands in log file by default + add --debug-module-cmds option to opt-in to keeping them#5045

Merged
Crivella merged 6 commits intoeasybuilders:developfrom
Flamefire:silent-module-cmd
Feb 23, 2026
Merged

hide output of module commands in log file by default + add --debug-module-cmds option to opt-in to keeping them#5045
Crivella merged 6 commits intoeasybuilders:developfrom
Flamefire:silent-module-cmd

Conversation

@Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Nov 14, 2025

This is disabled by default and hides the output of the module command.
That is usually just "noise" hiding the relevant part of the log.

With it disabled the output looks like:

== 2025-11-14 10:58:31,197 run.py:511 INFO Running shell command '/opt/lmod/lmod/libexec/lmod python load GCC/4.6.3' in /git/easybuild-framework
== 2025-11-14 10:58:31,261 run.py:625 INFO Shell command completed successfully: /opt/lmod/lmod/libexec/lmod python load GCC/4.6.3

I added small refactorings and fixes I've seen:

  • The type hint allows auto-completing in IDEs which is quite helpful for writing the test
  • re.sub('module use [...]', modtxt, re.M) was wrong: The 3rd parameter is count not flags

Includes:

@boegel
Copy link
Member

boegel commented Dec 7, 2025

@Flamefire merge conflict to resolve...

@Flamefire
Copy link
Contributor Author

Looks like I identified and fixed the same bug in the tests in multiple occasions.

Rebased

@Flamefire Flamefire force-pushed the silent-module-cmd branch 3 times, most recently from e7488a2 to 549c4ec Compare December 18, 2025 11:23
@boegel boegel modified the milestones: next release (5.2.1), 5.x Feb 11, 2026
This is disabled by default and hides the output of the module command.
That is usually just "noise" hiding the relevant part of the log.

With it disabled the output looks like:
> == 2025-11-14 10:58:31,197 run.py:511 INFO Running shell command '/opt/lmod/lmod/libexec/lmod python load GCC/4.6.3' in /git/easybuild-framework
> == 2025-11-14 10:58:31,261 run.py:625 INFO Shell command completed successfully: /opt/lmod/lmod/libexec/lmod python load GCC/4.6.3
Copy link
Contributor

@Crivella Crivella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

  • Fix bug in usage of re.sub where re.M was being passed to count instead of flags (plus usage as positional arguments is deprecated since 3.13 )
  • Re-naming of argument default value and logic properly
    • allow to keep using old one and adds a deprecation warning for it
    • keeps default behavior consistent with old one
    • Does not affect any other place than what is touched here (.unload is always called without specifying log_changes throughout the EB repositories)
  • Add tests for checking that module logs are properly shown/hidden

@Crivella
Copy link
Contributor

Going in, thanks @Flamefire!

@Crivella Crivella merged commit 00eb94f into easybuilders:develop Feb 23, 2026
40 checks passed
@Flamefire Flamefire deleted the silent-module-cmd branch February 23, 2026 09:58
@boegel boegel changed the title Add --debug-module-cmds option hide output of module commands in log file by default + add --debug-module-cmds option to opt-in to keeping them Feb 25, 2026
@boegel boegel added the change label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants