At load time, the environment variable STK_lOG_LEVEL is read to initialize the log level of the main log source, used by debug, info, warn, err and app. Default level is Logs.level.Warning. The set_level function should be used to modify the log level of the source; it also updates some internal structure to prevent creating a new closure each time debug is called, by using the [%debug] node extension.
The create_src function creates a new log source whose messages are tagged with the "stk" tag. This is useful to separate Stk log messages from other log messages, as stk log messages should not be displayed in the Gui (this could cause some infinite loop). The creation of a new log source reads the corresponding environment variable to initialize the log level of the new source. For example, !create_src "stk.foo" will create a new log source and whose level will be initialized by looking at the STK_FOO_LOG_LEVEL.
Textlog module provides a Logs.reporter to dispatch messages based on the tags attached to the message.