Message_templates.LoggerLogger interface - main logging interface
module type S = sig ... endLogger signature
module type ENRICHER = sig ... endEnricher signature - adds properties to log events
module type FILTER = sig ... endFilter signature - determines if an event should be logged
val create :
min_level:Level.t ->
sinks:(Composite_sink.sink_fn * Level.t option) list ->
tCreate a logger with minimum level and sinks (with optional per-sink level filtering)
Core write method
val verbose : t -> ?exn:exn -> string -> (string * Yojson.Safe.t) list -> unitval debug : t -> ?exn:exn -> string -> (string * Yojson.Safe.t) list -> unitval information :
t ->
?exn:exn ->
string ->
(string * Yojson.Safe.t) list ->
unitval warning : t -> ?exn:exn -> string -> (string * Yojson.Safe.t) list -> unitval error : t -> ?exn:exn -> string -> (string * Yojson.Safe.t) list -> unitval fatal : t -> ?exn:exn -> string -> (string * Yojson.Safe.t) list -> unitCreate a contextual logger with additional property
val with_enricher : t -> (Log_event.t -> Log_event.t) -> tAdd an enricher function
val flush : t -> unitFlush all sinks
val close : t -> unitClose all sinks
Helper to add a property enricher - alias for for_context
val add_filter : t -> (Log_event.t -> bool) -> tAdd a custom filter function