Stk.Log
Logging.
Stk uses a Logs
.Src.t whose log functions are available in this module. Some modules also uses their own Logs
.Src.t (like Textview
or Textbuffer
).
At load time, the environment variable STK_lOG_LEVEL
is read to initialize the log level of log_src
. Default is Logs
.warning.
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.
module type LOG = sig ... end
val create_src : ?doc:'a -> string -> (module LOG)
include LOG
include Logs.LOG
The list of stk log sources (i.e. the log sources created by create_src
).