Module Brr.Debug

module Debug: sig .. end
Debugging tools.


Debug


val enter : unit -> unit
enter () stops and enters the JavaScript debugger (if available).
val pp_obj : Format.formatter -> < .. > Js.t -> unit
pp_obj ppf o applies the method toString to object o and prints the the resulting string on ppf.
val dump_obj : < .. > Js.t -> unit
dump_obj o dumps object o on the browser console with level debug.

Tracing


val trace : ?pp:(Format.formatter -> 'a -> unit) -> string -> 'a -> 'a
trace ~pp v traces with Brr.Log.debug the value of v with pp (default is a no-op) and identifier id. The function returns v.
val tick : Format.formatter -> 'a -> unit
tick formats "tick" on any value.
val trace_e : ?obs:bool ->
?pp:(Format.formatter -> 'a -> unit) ->
string -> 'a Note.event -> 'a Note.event
trace_e ~pp id e traces e's occurence with Brr.Log.debug, pp (defaults to Brr.Debug.tick) and identifier id. If obs is true, the return value is e itself and the tracing occurs through a logger, this will prevent e from being garbage collected. If obs is false, the return value is e mapped by a tracing identity.
val trace_s : ?obs:bool ->
?pp:(Format.formatter -> 'a -> unit) ->
string -> 'a Note.signal -> 'a Note.signal
trace_s ~pp id s traces s's changes with Brr.Log.debug, pp and identifier id. If obs is true, the return value is s itself and the tracing occurs through a logger, this will prevent s from being gc'd. If obs is false, the return value is s mapped by a tracing identity and using s's equality function.