Module Debug

module Debug: sig .. end

Debug flag handling


type flag 
val register_flag : desc:Pp.formatted -> string -> flag

register a new flag. It is allowed to register twice the same flag

val register_info_flag : desc:Pp.formatted -> string -> flag

register a new info flag. It is allowed to register twice the same flag. Info flags are set by --debug-all and must not change the behaviour.

val list_flags : unit -> (string * flag * bool * Pp.formatted) list

list the known flags

val lookup_flag : string -> flag

get the flag

val is_info_flag : string -> bool

test if the flag is an info flag

val flag_desc : string -> Pp.formatted

get the description of the flag

val set_flag : flag -> unit

Modify the state of a flag

val unset_flag : flag -> unit
val toggle_flag : flag -> unit
val test_flag : flag -> bool

Return the state of the flag

val test_noflag : flag -> bool
val set_debug_formatter : Format.formatter -> unit

Set the formatter used when printing debug material

val get_debug_formatter : unit -> Format.formatter

Get the formatter used when printing debug material

val dprintf : flag -> ('a, Format.formatter, unit) Pervasives.format -> 'a

Print only if the flag is set

val stack_trace : flag

stack_trace flag

module Args: sig .. end

Command line arguments

val stats : flag
type 'a stat 
module Stats: sig .. end