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 -> ?split_files_after:int -> ?for_append:bool -> string -> (module Debug_ch)

Sets up a file with the given path, or if split_files_after is given, creates a directory to store the files. By default the logging will not be time tagged and will be appending to the file / creating more files. If split_files_after is given and for_append is false, clears the directory. If the opened file exceeds split_files_after characters, Debug_ch.refresh_ch () returns true; if in that case Debug_ch.debug_ch () is called, it will create and return a new 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 PrintBox_runtime = 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_file : ?time_tagged:bool -> ?split_files_after:int -> ?highlight_terms:Re.t -> ?exclude_on_path:Re.t -> ?prune_upto:int -> ?truncate_children:int -> ?for_append:bool -> ?boxify_sexp_from_size:int -> ?backend: [ `Text | `Html of PrintBox_html.Config.t | `Markdown of PrintBox_md.Config.t ] -> ?hyperlink:string -> ?values_first_mode:bool -> string -> (module PrintBox_runtime)

Creates a PrintBox-based debug runtime configured to output html or markdown to a file with the given name suffixed with ".log", ".html" or ".md" depending on the backend. 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.

By default backend is `Markdown PrintBox.default_md_config. See PrintBox.config for details about PrintBox-specific parameters. See debug_ch for the details about shared parameters.

val debug : ?debug_ch:out_channel -> ?time_tagged:bool -> ?highlight_terms:Re.t -> ?exclude_on_path:Re.t -> ?prune_upto:int -> ?truncate_children:int -> ?values_first_mode:bool -> unit -> (module PrintBox_runtime)

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

val debug_flushing : ?debug_ch:out_channel -> ?time_tagged:bool -> 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.