easy_logging

Module to log messages. Aimed at being both powerful and easy to use
Library easy_logging
type level =
| Debug
| Trace
| Info
| Warning
| Error
| Flash
| NoLevel

Possible level of a log item.

val level_of_string : string -> ( level, string ) result
val show_level : level -> string
val pp_level : Format.formatter -> level -> unit
type log_item = {
level : level;
logger_name : string;
msg : string;
tags : string list;
timestamp : float;
}
val debug : bool ref
class logger : ?parent:logger option -> string -> object ... end
val get_logger : string -> logger

Returns a registered logger by name, creating it if does not exist.

val make_logger : ?propagate:bool -> string -> level -> Handlers.desc list -> logger

Convenience method used to fetch a logger and initialize it.

make_logger name level handlers_descs calls get_logger with the given name, then sets its level, adds the handlers, and then returns it.

Calling this function multiple times with the same name will keep adding handlers.

val handlers_config : Handlers.config ref
val set_handlers_config : Handlers.config -> unit
val tree_to_yojson : unit -> [> `Assoc of (string * [> `List of 'a list | `String of string ]) list ] as 'a

Returns the logging tree as yojson, with logger name and level as node data.