TracelogSourceTracelog is the main logging module for codex.
Instanciate a new logger with Tracelog.Make:
module Log = Tracelog.Make(struct let category = "MyCategory" end)You can then use logging functions Log.error, Log.warning, Log.notice, Log.info, and Log.debug (in increasing verbosity level). Additionally, Log.fatal prints and exits. Finally, Log.trace can be used to trace entry/return into a function.
For a short tutorial, see Tracelog Debugging in Codex.
You can change the global level using set_verbosity_level (set to `Notice by default).
A function that behaves like printf.
A log message takes a printf function and print with it. This avoid the need to parse and evaluate arguments when we do not log.
Verbosity level, from less to most verbose. Default is to display everything below `Warning. Feedback levels are from less to more verbose (normal levels are from 0 to 2, but you can pass bigger numbers.)
reset the location stack, USE ONLY IF YOU KNOW WHAT YOU ARE DOING
The current stack of locations set by trace.
If we have location information, it will be printed using this function.
Standard functor: verbosity level is controlled by set_verbosity_level.
This is useful when developping and debugging a specific module: we can enable debugging forthis module by replacing the Make call by MakeDebug.
Completely silence this debug output.