Module Logs

type level =
  1. | App
  2. | Error
  3. | Warning
  4. | Info
  5. | Debug
val level : unit -> level option
val set_level : ?all:bool -> level option -> unit
val pp_level : Format.formatter -> level -> unit
val level_to_string : level option -> string
val level_of_string : string -> (level option, [ `Msg of string ]) result
type src
val default : src
module Src : sig ... end
module Tag : sig ... end
type (!'a, !'b) msgf = (?header:string -> ?tags:Tag.set -> ('a, Format.formatter, unit, 'b) format4 -> 'a) -> 'b
type !'a log = ('a, unit) msgf -> unit
val msg : ?src:src -> level -> 'a log
val app : ?src:src -> 'a log
val err : ?src:src -> 'a log
val warn : ?src:src -> 'a log
val info : ?src:src -> 'a log
val debug : ?src:src -> 'a log
val kmsg : (unit -> 'b) -> ?src:src -> level -> ('a, 'b) msgf -> 'b
val on_error : ?src:src -> ?level:level -> ?header:string -> ?tags:Tag.set -> pp:(Format.formatter -> 'b -> unit) -> use:('b -> 'a) -> ('a, 'b) result -> 'a
val on_error_msg : ?src:src -> ?level:level -> ?header:string -> ?tags:Tag.set -> use:(unit -> 'a) -> ('a, [ `Msg of string ]) result -> 'a
module type LOG = sig ... end
val src_log : src -> (module LOG)
type reporter = {
  1. report : 'a 'b. src -> level -> over:(unit -> unit) -> (unit -> 'b) -> ('a, 'b) msgf -> 'b;
}
val nop_reporter : reporter
val format_reporter : ?pp_header:(Format.formatter -> (level * string option) -> unit) -> ?app:Format.formatter -> ?dst:Format.formatter -> unit -> reporter
val reporter : unit -> reporter
val set_reporter : reporter -> unit
val set_reporter_mutex : lock:(unit -> unit) -> unlock:(unit -> unit) -> unit
val report : src -> level -> over:(unit -> unit) -> (unit -> 'b) -> ('a, 'b) msgf -> 'b
val incr_err_count : unit -> unit
val incr_warn_count : unit -> unit
val pp_print_text : Format.formatter -> string -> unit
val pp_header : Format.formatter -> (level * string option) -> unit
val err_count : unit -> int
val warn_count : unit -> int