package ppx_minidebug

  1. Overview
  2. Docs

The functors creating a Debug_runtime module that ppx_minidebug requires.

module type Debug_ch = sig ... end
val debug_ch : ?time_tagged:bool -> ?max_nesting_depth:int -> ?max_num_children:int -> ?for_append:bool -> string -> (module Debug_ch)

Opens a file with the given path. By default the logging will not be time tagged and will be appending to the file.

module type Debug_runtime = sig ... end

When using the ppx_minidebug syntax extension, provide a module called Debug_runtime with this signature in scope of the instrumented code.

The logged traces will be indented using OCaml's `Format` module.

The output is flushed line-at-a-time, so no output should be lost if the traced program crashes. The logged traces are still indented, but if the values to print are multi-line, their formatting might be messy. The indentation is also smaller (half of PrintBox).

module type Debug_runtime_cond = sig ... end
module PrintBox (_ : Debug_ch) : sig ... end

The logged traces will be pretty-printed as trees using the `printbox` package. This logger supports conditionally disabling a particular nesting of the logs, regardless of where in the nesting level no_debug_if is called.

val debug_html : ?time_tagged:bool -> ?max_nesting_depth:int -> ?max_num_children:int -> ?for_append:bool -> ?boxify_sexp_from_size:int -> string -> (module Debug_runtime_cond)

Creates a PrintBox-based debug runtime configured to output html to a file with the given name. By default the logging will not be time tagged and the file will be created or erased by this function. The default boxify_sexp_from_size value is 50.

val debug : ?debug_ch:out_channel -> ?time_tagged:bool -> ?max_nesting_depth:int -> ?max_num_children:int -> unit -> (module Debug_runtime_cond)

Creates a PrintBox-based debug runtime. By default it will log to stdout and will not be time tagged.

val debug_flushing : ?debug_ch:out_channel -> ?time_tagged:bool -> ?max_nesting_depth:int -> ?max_num_children:int -> unit -> (module Debug_runtime)

Creates a PrintBox-based debug runtime. By default it will log to stdout and will not be time tagged.

OCaml

Innovation. Community. Security.