Module Log
Logging and messaging
module type Sig = sig ... end
Logging functions accessible directly
include Sig
type 'a log_printer
= Lib.log_level -> ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
type 'a m_log_printer
= Lib.kind_module -> 'a log_printer
Logging
val set_module : Lib.kind_module -> unit
Set module currently running
val get_module : unit -> Lib.kind_module
Get module currently running
val get_log_format : unit -> log_format
Returns the log format
val set_log_format : log_format -> unit
Chooses the log format
Auxiliary functions
val pp_print_kind_module_xml_src : Stdlib.Format.formatter -> Lib.kind_module -> unit
val print_xml_trailer : unit -> unit
val printf_xml : 'a m_log_printer
val printf_json : 'a m_log_printer
val parse_log_xml : Lib.log_level -> Lib.position -> string -> unit
val parse_log_json : Lib.log_level -> Lib.position -> string -> unit
module type SLog = sig ... end
module Make : functor (R : sig ... end) -> SLog
Create a logging module parameterized by a relay function
One instance without relay is available directly
include SLog
val log : 'a log_printer
log m l f v ...
outputs a message from modulem
on levell
, formatted with the parameterized stringf
and the valuesv ...
val log_uncond : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
log_uncond m f v ...
outputs a message from modulem
unconditionally, formatted with the parameterized stringf
and the valuesv ...
val log_result : (Stdlib.Format.formatter -> 'a -> unit) -> (Stdlib.Format.formatter -> 'a -> unit) -> (Stdlib.Format.formatter -> 'a -> unit) -> 'a -> unit
log_result pt xml json a
outputs a result (for instance, for a post analysis) by choosing the right printing function depending on the output format