Module Easy_logging__.Handlers

type log_formatter = Easy_logging__.Logging_types.log_item -> string

Type definitions

type filter = Easy_logging__.Logging_types.log_item -> bool
type t = {
mutable fmt : log_formatter;
mutable level : Easy_logging__.Logging_types.level;
mutable filters : filter list;
output : string -> unit;
}

Type of a handler

Handlers creation helpers

module CliHandler : sig ... end

Module to create handlers that output to stdout or stderr.

module FileHandler : sig ... end

Module to create handlers that output to a file.

type config = {
file_handlers : FileHandler.config;
}
val default_config : config
type desc =
| Cli of Easy_logging__.Logging_types.level
| CliErr of Easy_logging__.Logging_types.level
| File of string * Easy_logging__.Logging_types.level
| RotatingFile of string * Easy_logging__.Logging_types.level * int * int
val make : ?⁠config:config -> desc -> t

Handlers setup

val set_level : t -> Easy_logging__.Logging_types.level -> unit

Sets the level of a handler.

val set_formatter : t -> log_formatter -> unit

Sets the formatter of a handler.

val add_filter : t -> filter -> unit

Adds a filter to a handler.

val apply : t -> Easy_logging__.Logging_types.log_item -> unit

Auxiliary function.