80 | | TODO - logset |
| 80 | It is also possible to change reported log level at run-time. For that the user shall use the `logset` utility. The utility is controlled purely via its command-line arguments - one of them is always the name of the level that is supposed to be set. |
| 81 | |
| 82 | To change the default reporting level, simply run `logset` with the level name - following would make the system very quiet. |
| 83 | {{{ |
| 84 | logset fatal |
| 85 | }}} |
| 86 | |
| 87 | To change the reporting level of a certain log, run `logset` with the log name followed by the level name. For example, to make devman more verbose, run the following: |
| 88 | {{{ |
| 89 | logset devman debug2 |
| 90 | }}} |
| 91 | |
| 92 | It is also possibly to target a nested log - simply separate individual names with a slash (like in a file name). |
| 93 | |
| 94 | '''Example (tester logger2)''': To demonstrate how setting log levels at run-time works, you shall open at least three terminals. In one, start the `tester` with `logger2` test. This test only prints messages at different levels to different logs. |
| 95 | |
| 96 | In the second, you shall monitor the tester log - either by `cat`ting `/log/tester` or you can switch to kernel console (if you configure HelenOS without GUI, seventh console shall display that output). |
| 97 | |
| 98 | And in the third console you can issue the `logset` to see what happens. |
| 99 | |
| 100 | By default, you would see that `tester` continuously prints errors, warnings and notes into three logs: the default one (i. e. `tester`), `alpha` and `bravo` (`tester/alpha` and `tester/alpha/bravo`). |
| 101 | |
| 102 | Running |
| 103 | {{{ |
| 104 | logset tester/alpha fatal |
| 105 | }}} |
| 106 | would mute all the output to `alpha` and `alpha/bravo` logs. The reason why `bravo` was muted as well is because it is a child of `alpha` and has to respect its settings (unless explicitly overridden). |
| 107 | |
| 108 | But it is possible to explicitly enable `bravo` output. If we ran |
| 109 | {{{ |
| 110 | logset tester/alpha/bravo warn |
| 111 | }}} |
| 112 | the `alpha` is still muted but together with the original `tester` messages, `bravo` warnings are interleaved. |
| 113 | |