Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookbook: Log Module Commands doesn't log "ml <module>" command(s) #412

Closed
fidoedidoe opened this issue Sep 16, 2021 · 2 comments
Closed
Labels
Milestone

Comments

@fidoedidoe
Copy link

fidoedidoe commented Sep 16, 2021

Describe the bug

Using the cookbook for Log Module Commands module load / unload commands invoked by "ml" (ie "ml , or ml -" are not logged. It would be nice to see a more complete cookbook example for: Logging Module Commands. FYI using "ml load does log the commands so the issue is with the "shorthand" when using ml for load / unload

To Reproduce

  • Update siteconfig.tcl as described in the cookbook: Log Module Commands
  • execute: module load|unload to test logging is working.
  • execute: ml or ml - and you will see that nothing is logged
  • execute ml load or ml unload you will see an entry into the log,
  • execute: ml av and you will see "avail" is logged, proving some aspects of the ml command are captured

Expected behavior

I would expect all module commands including all ml commands to be logged (especially the load/unload as directed for use in ml documentation)

Error and debugging information

No errors are logged, this feels like an omission in the change to siteconfig.tcl (from the cookbook)

Modules version and configuration

$ module --version
Modules Release 4.8.0 (2021-07-14)
$ module config --dump-state
Modules Release 4.8.0 (2021-07-14)

- Config. name ---------.- Value (set by if default overridden) ---------------
advanced_version_spec     0
auto_handling             0
avail_indepth             1
avail_output              modulepath:alias:dirwsym:sym:tag:key
avail_terse_output        modulepath:alias:dirwsym:sym:tag
collection_pin_version    0
collection_target         <undef>
color                     auto (env-var)
colors                    hi=1:db=2:tr=2:se=2:er=91:wa=93:me=95:in=94:mp=1;94:di=94:al=96:va=93:sy=95:de=4:cm=92:aL=100:L=90;47:H=2:F=41:nF=43:S=46:sS=44
contact                   jdoe@acme.com (env-var)
csh_limit                 4000
editor                    vim (env-var)
extended_default          0
extra_siteconfig          <undef>
home                      /usr/local/Modules (env-var)
icase                     never
ignored_dirs              CVS RCS SCCS .svn .git .SYNC .sos
implicit_default          1
implicit_requirement      1
list_output               header:idx:variant:sym:tag:key
list_terse_output         header
locked_configs
mcookie_version_check     1
ml                        1
nearly_forbidden_days     14
pager                     /usr/bin/less -eFKRX
rcfile                    <undef>
run_quarantine            <undef>
search_match              starts_with
set_shell_startup         1
shells_with_ksh_fpath
silent_shell_debug        <undef>
siteconfig                /usr/local/Modules/etc/siteconfig.tcl
tag_abbrev                auto-loaded=aL:loaded=L:hidden=H:hidden-loaded=H:forbidden=F:nearly-forbidden=nF:sticky=S:super-sticky=sS
tag_color_name
tcl_ext_lib               /usr/local/Modules/lib/libtclenvmodules.so
term_background           dark
term_width                0
unload_match_order        returnlast
variant_shortcut
verbosity                 normal
wa_277                    0

- State name -----------.- Value ----------------------------------------------
always_read_full_file     1
autoinit                  0
clock_seconds             1631779111
cmdline                   /usr/local/Modules/libexec/modulecmd.tcl csh config --dump-state
commandname               config
domainname                (none)
error_count               0
extra_siteconfig_loaded   0
false_rendered            0
force                     0
hiding_threshold          0
inhibit_errreport         0
inhibit_interp            0
init_error_report         1
is_stderr_tty             1
is_win                    0
kernelversion             #1 SMP Mon Aug 30 07:26:31 EDT 2021
lm_info_cached            0
machine                   x86_64
modulefile                {}
nodename                  secret
os                        Linux
osversion                 4.18.0-305.17.1.el8_4.x86_64
paginate                  1
path_separator            :
report_format             regular
reportfd                  file5
return_false              0
shell                     csh
shelltype                 csh
siteconfig_loaded         1
sub1_separator            &
sub2_separator            |
subcmd                    config
subcmd_args               --dump-state
tcl_ext_lib_loaded        1
tcl_version               8.6.8
tcl_version_lt85          0
term_columns              99
try_modulefile            0
usergroups                secret stuff here 
username                  jdoe

- Env. variable --------.- Value ----------------------------------------------
MODULECONTACT             jdoe@acme.com
MODULEPATH                /hardware/tools/local/modulefiles
MODULEPATH_modshare       /usr/local/Modules/modulefiles:1
MODULESHOME               /usr/local/Modules
MODULES_CMD               /usr/local/Modules/libexec/modulecmd.tcl
MODULES_COLOR             auto
MODULES_EDITOR            vim
PATH_modshare             /home/jdoe/.local/bin:1:/usr/sbin:1:/usr/bin:1:/usr/local/sbin:1:/home/jdoe/bin/:1:/usr/local/bin:1```

### Additional context
None

<!-- Thanks helping us to improve Modules -->
@fidoedidoe fidoedidoe added the bug label Sep 16, 2021
@xdelaruelle
Copy link
Member

Thanks for this report. I will change the cookbook not to track all module commands, but to track all module evaluation (whether they came from a module or a ml command).

@xdelaruelle
Copy link
Member

After all I will also provide a way to track the module and ml calls in addition to the module evaluation.

@xdelaruelle xdelaruelle added this to the 5.0.1 milestone Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants