Module Trace


module Trace: sig  end
Rudimentary tracing capability.
Author(s): Harald Ruess


All trace messages are directed to Format.err_formatter. The amount of tracing output is determined by the the set of active trace levels.


type level = string
val registered : (level * string) list Pervasives.ref
val reset : unit -> unit
Reset the set of trace levels to the empty set, that is, all tracing is disabled.
Parameters:
() : unit
val add : level -> unit
add l activates the trace level l.
Parameters:
l : level
val is_active : level -> bool
Test if certain trace level is active.
Parameters:
l : level
val remove : level -> unit
remove l deactivates the trace level l.
Parameters:
l : level
val get : unit -> level list
get () returns the set of currently active trace levels as a list.
Parameters:
() : unit
val indent : int Pervasives.ref
val call : level -> string -> 'a -> 'a Pretty.printer -> unit
call l name arg pp outputs a function call trace message if l is currently active by first outputting name followed by printing arg using the pp printer.
Parameters:
level : level
op : string
args : 'a
pp : 'a Pretty.printer
val exit : level -> string -> 'a -> 'a Pretty.printer -> unit
exit l name arg pp outputs a function exit trace message if l is currently active by first outputting name followed by printing arg using the pp printer.
Parameters:
level : level
op : string
res : 'a
pp : 'a Pretty.printer
val fail : level -> string -> exn -> unit
fail l exc outputs a failure warining if l is curently active, and raises exception exc.
Parameters:
level : level
name : string
exc : exn
val msg : level -> string -> 'a -> 'a Pretty.printer -> unit
msg l name arg pp outputs a trace message if l is currently active by first outputting name followed by printing arg using the pp printer.
Parameters:
level : level
op : string
args : 'a
pp : 'a Pretty.printer
val func : level ->
string -> 'a Pretty.printer -> 'b Pretty.printer -> ('a -> 'b) -> 'a -> 'b
func l name pp qq f provides a trace wrapper for function f for calling call before applying f and exit after applying f. In addition, messages are output if f raises an exception. Except for the outputting of trace messages on stderr, the functional behavior of f is unchanged.
Parameters:
level : level
name : string
pp : 'a Pretty.printer
qq : 'b Pretty.printer
f : 'a -> 'b
a : 'a
val func2 : level ->
string ->
'a Pretty.printer ->
'b Pretty.printer -> 'c Pretty.printer -> ('a -> 'b -> 'c) -> 'a -> 'b -> 'c
Parameters:
level : level
name : string
pp1 : 'a Pretty.printer
pp2 : 'b Pretty.printer
pp3 : 'c Pretty.printer
f : 'a -> 'b -> 'c
a : 'a
b : 'b
val proc : level -> string -> 'a Pretty.printer -> ('a -> unit) -> 'a -> unit
proc l name pp f is just func l name pp Pretty.unit f.
Parameters:
level : level
? : string
? : 'a Pretty.printer
? : 'a -> unit
? : 'a