Hi all,
Firstly, apologies if this is a silly question. I've never used TCL outside
of module files before.
I'm on a shared system where we are stuck with Modules v3.2.10 (TCL 8.5).
I've been trying to enable logging so we have a record of which modules are
being loaded most often, but I've been struggling to configure it properly.
Under `man module`, I found that I can add a `~/.modulerc` which gets
executed on any module commands. Further, under `man modulefile`, I found
that I can log to a personal file using
```
#%Module1.0
module-trace on load
module-log trace /home/lexg/modules.log
```
This is alright, if I execute `module load cuda`, I see some output like
```
bash load cuda <...> = TCL_OK(0)
```
However, subsequent module load commands simply keep appending to the first
line, rather than starting on newlines. *Is there any way to change this?*
I then tried to use the `trace` command in TCL similar to the examples in
https://modules.readthedocs.io/en/latest/cookbook/log-module-commands.html,
but I could never get this to produce any output at all. One configuration
I tried just to get *any* output upon `module load` was:
```
proc printArguments args {
foreach arg $args {
puts stderr $arg
}
}
trace add execution module leave printArguments
```
I also tried outputting to files (`exec echo "BLAH" > /home/lexg/modules.log`)
but to no avail.
I could find no real examples of `trace add execution` outside of the
cookbook example linked above. *Is there a way to use `trace` so I can
better format the output, or am I stuck with module-log?* Thanks in advance.
*LEX GALLON*
Research Officer, Monash e-Research Centre
|