package easy_logging

  1. Overview
  2. Docs

Default implementation of a Handlers module.

  • Cli handler: outputs colored messages to stdout

    let h = Default_handlers.make (Cli Debug) 
  • File handler : outputs messages to a given file

    let h = Default_handlers.make (File ("filename", Debug)) 
type t = {
  1. mutable fmt : Easy_logging__.Easy_logging_types.log_item -> string;
  2. mutable level : Easy_logging__.Easy_logging_types.level;
  3. output : out_channel;
}

handler type

val outputs : (string, out_channel) Hashtbl.t
val apply : t -> Easy_logging__.Easy_logging_types.log_item -> unit
val make_cli_handler : Easy_logging__.Easy_logging_types.level -> t
val make_file_handler : Easy_logging__.Easy_logging_types.level -> string -> t
val set_level : t -> Easy_logging__.Easy_logging_types.level -> unit
val set_formatter : t -> (Easy_logging__.Easy_logging_types.log_item -> string) -> unit
val handlers : (string, t) Hashtbl.t
val register_handler : string -> t -> unit
type desc =
  1. | Reg of string
val make : desc -> t
val handle_test : t -> Easy_logging__.Easy_logging_types.log_item -> unit
OCaml

Innovation. Community. Security.