DbgDebug trace logging
val none : configval all : configval parse_exn : string -> configParse a trace specification string to a config. May raise Parse_failure.
val init : ?colors:bool -> ?margin:int -> ?config:config -> unit -> unitInitialize the configuration of debug tracing.
type 'a printf = ('a, unit) fmt -> 'aval pp_styled :
[ `Bold | `Cyan | `Magenta ] ->
('a, unit) fmt ->
Stdlib.Format.formatter ->
'aIf config.colors is set to true, print in the specified color
val printf : string -> 'a printfLike Format.printf, if enabled, otherwise like Format.iprintf.
val fprintf : string -> Stdlib.Format.formatter -> 'a printfLike Format.fprintf, if enabled, otherwise like Format.ifprintf.
val kprintf : string -> (Stdlib.Format.formatter -> unit) -> 'a printfLike Format.kprintf, if enabled, otherwise like Format.ifprintf.
val info : string -> 'a printfEmit a message at the current indentation level, if enabled.
val infok : string -> (pf -> 'a) -> 'aEmit a message at the current indentation level, if enabled.
val call : string -> (pf -> 'a) -> 'aIncrease indentation level and emit a message, if enabled.
val retn : string -> (pf -> 'a -> unit) -> 'a -> 'aDecrease indentation level and emit a message, if enabled.
val dbg :
?call:(pf -> unit) ->
?retn:(pf -> 'a -> unit) ->
?rais:(pf -> exn -> Stdlib.Printexc.raw_backtrace -> unit) ->
string ->
(unit -> 'a) ->
'adbg ~call ~retn ~rais function_name k increases the indentation level and emits the call message, then invokes k (), then decreases the indentation level and either emits the retn or rais message, depending on whether k () returned normally or exceptionally. If tracing function_name is not enabled, nothing is printed, but the call, retn, and rais functions are still executed.
val dbgs :
(('s -> 'r * 's) -> 'n) ->
('m -> 's -> 'r * 's) ->
?call:(pf -> unit) ->
?retn:(pf -> ('r * ('s * 's)) -> unit) ->
?rais:(pf -> 's -> exn -> Stdlib.Printexc.raw_backtrace -> unit) ->
string ->
'm ->
'ndbgs thunk force is similar to dbg but parameterized by a decomposition of a function 'm -> 'n into and intermediate state-passing form using force : 'm -> ('s -> 'r * 's) and thunk : ('s -> 'r * 's) -> 'n.
val raisef : ?margin:int -> (string -> exn) -> ('a, unit -> _) fmt -> 'aTake a function from a string message to an exception, and a format string with the additional arguments it specifies, and then call the function on the formatted string and raise the returned exception.
val fail : ('a, unit -> _) fmt -> 'aEmit a message at the current indentation level, and raise a Failure exception indicating a fatal error.