Module Tracelog
Tracelog 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.
type 'a log = 'a printf -> unitA 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
val current_location : unit -> location optionThe innermost location set by trace.
val current_location_stack : unit -> location listThe current stack of locations set by trace.
val set_pp_location_stack :
(Stdlib.Format.formatter -> location list -> unit) ->
unitIf we have location information, it will be printed using this function.
module type S = sig ... endStandard 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.
module MakeSilent (Category : sig ... end) : SCompletely silence this debug output.