Debian Codegraph @

doc/source/cookbook/inhibit-report-info.rst

raw
1 .. _inhibit-report-info:
2
3 Inhibit output of informative messages
4 ======================================
5
6 Since Modules v4.2, additional module load or unload triggered by the load
7 or the unload of a modulefile are reported to the user to help understand
8 what happened automatically. These informative messages may not be desired
9 sometimes and here is a proposed way to inhibit them.
10
11 Implementation
12 --------------
13
14 Starting version v4.3, a :mconfig:`verbosity` configuration option is
15 introduced to increase or decrease the variety of the messages produced by the
16 ``module`` command. To inhibit the output of the info-level messages, the
17 ``concise`` verbosity level should be selected::
18
19 $ module config verbosity concise
20
21 For v4.2 versions, a site-specific configuration script is proposed to inhibit
22 the output of the info-level messages.
23
24 .. literalinclude:: ../../example/inhibit-report-info/siteconfig.tcl
25 :language: tcl
26 :caption: siteconfig.tcl
27 :lines: 14-23
28
29 **Compatible with Modules v4.2**
30
31 Installation (only for version older than v4.3)
32 -----------------------------------------------
33
34 Create site-specific configuration directory if it does not exist yet:
35
36 .. parsed-literal::
37
38 $ mkdir \ |etcdir|
39
40 Then copy there the site-specific configuration script of this recipe:
41
42 .. parsed-literal::
43
44 $ cp example/inhibit-report-info/siteconfig.tcl \ |etcdir|\ /
45
46 .. note::
47
48 Defined location for the site-specific configuration script may vary from
49 one installation to another. To determine the expected location for this
50 file on your setup, check the ``modulecmd.tcl`` script::
51
52 $ grep '^set g_siteconfig ' $MODULES_CMD
53
54 Usage example
55 -------------
56
57 With a bare ``bar`` modulefile:
58
59 .. literalinclude:: ../../example/inhibit-report-info/modulefiles/bar
60 :caption: bar
61
62 And a ``foo`` modulefile that pre-requires ``bar``:
63
64 .. literalinclude:: ../../example/inhibit-report-info/modulefiles/foo
65 :caption: foo
66
67 Enable the modulepath where the example modulefiles are located::
68
69 $ module use example/inhibit-report-info/modulefiles
70
71 Load ``foo`` with auto handling mode enabled. The info-level message
72 inhibition should let ``foo`` load quiet::
73
74 $ module load --auto foo
75 $
76
77 .. vim:set tabstop=2 shiftwidth=2 expandtab autoindent: