Module type Logger.S

Logger signature

type t
val write : t -> ?exn:exn -> Level.t -> string -> (string * Yojson.Safe.t) list -> unit

Core write method

val is_enabled : t -> Level.t -> bool

Level checking

val verbose : t -> ?exn:exn -> string -> (string * Yojson.Safe.t) list -> unit

Convenience methods for each level

val debug : t -> ?exn:exn -> string -> (string * Yojson.Safe.t) list -> unit
val information : t -> ?exn:exn -> string -> (string * Yojson.Safe.t) list -> unit
val warning : t -> ?exn:exn -> string -> (string * Yojson.Safe.t) list -> unit
val error : t -> ?exn:exn -> string -> (string * Yojson.Safe.t) list -> unit
val fatal : t -> ?exn:exn -> string -> (string * Yojson.Safe.t) list -> unit
val for_context : t -> string -> Yojson.Safe.t -> t

Context enrichment

val with_enricher : t -> (Log_event.t -> Log_event.t) -> t
val for_source : t -> string -> t

Sub-loggers for specific source types

val flush : t -> unit

Flush all sinks

val close : t -> unit

Close all sinks