easy_logging
Module to log messages. Aimed at being both powerful and easy to use
1024" x-on:close-sidebar="sidebar=window.innerWidth > 1024 && true">
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Library easy_logging
Type definitions
type t = {
mutable fmt : log_formatter; |
mutable level : Easy_logging__Logging_types.level; |
mutable filters : filter list; |
output : string -> unit; |
}
Type of a handler
A handler is made of:
- a formatter that transforms a log item into a string.
- a level used to filter out items.
- an array of possible additional custom filters.
- an
output
function, that takes a string and does the output job.
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.
val default_config : config
Used for quick handler creation, e.g.
Cli handler: outputs colored messages to stdout
let h = Handlers.make (Cli Debug)
File handler : outputs messages to a given file
let h = Handlers.make (File ("filename", Debug))
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 apply : t -> Easy_logging__Logging_types.log_item -> unit
Auxiliary function.