Library
Module
Module type
Parameter
Class
Class type
val mutable level : log_level
Value used to filter log messages.
type log_level = | Debug | Info | Warning | Error | Flash | NoLevel
val mutable handlers : Default_handlers.t list
Registered handlers for this logger
Each of these methods takes an optional tag list
, then a set of parameters the way a printf function does. If the log level of the instance is low enough, a log item will be created theb passed to the handlers.
Example :
logger#warning "Unexpected value: %s" (to_string my_value)
method flash : 'a. ?tags:Default_handlers.tag list ->
('a, unit, string, unit) format4 ->
'a
method error : 'a. ?tags:Default_handlers.tag list ->
('a, unit, string, unit) format4 ->
'a
method warning : 'a. ?tags:Default_handlers.tag list ->
('a, unit, string, unit) format4 ->
'a
method info : 'a. ?tags:Default_handlers.tag list ->
('a, unit, string, unit) format4 ->
'a
method debug : 'a. ?tags:Default_handlers.tag list ->
('a, unit, string, unit) format4 ->
'a
Each of these methods takes a string lazy_t
as an input (as well as the optional tag list
. If the log level of the instance is low enough, the lazy value will forced into a string
, a log item will be created then passed to the handlers.
Example:
logger#ldebug (lazy (heavy_calculation () ))
method ldebug : ?tags:Default_handlers.tag list -> string lazy_t -> unit
method linfo : ?tags:Default_handlers.tag list -> string lazy_t -> unit
method lwarning : ?tags:Default_handlers.tag list -> string lazy_t -> unit
method lerror : ?tags:Default_handlers.tag list -> string lazy_t -> unit
method lflash : ?tags:Default_handlers.tag list -> string lazy_t -> unit
These methods take a simple string as input.
method sdebug : ?tags:Default_handlers.tag list -> string -> unit
method serror : ?tags:Default_handlers.tag list -> string -> unit
method sflash : ?tags:Default_handlers.tag list -> string -> unit
method sinfo : ?tags:Default_handlers.tag list -> string -> unit
method swarning : ?tags:Default_handlers.tag list -> string -> unit
method add_handler : Default_handlers.t -> unit
Adds a handler to the logger instance.
method set_level : log_level -> unit
Sets the log level of the logger instance.