Page
Library
Module
Module type
Parameter
Class
Class type
Source
Logging.loggerval mutable level : log_levelValue used to filter log messages.
type log_level = | Debug | Info | Warning | Error | Flash | NoLevel 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 ->
'amethod error : 'a. ?tags:Default_handlers.tag list ->
('a, unit, string, unit) format4 ->
'amethod warning : 'a. ?tags:Default_handlers.tag list ->
('a, unit, string, unit) format4 ->
'amethod info : 'a. ?tags:Default_handlers.tag list ->
('a, unit, string, unit) format4 ->
'amethod debug : 'a. ?tags:Default_handlers.tag list ->
('a, unit, string, unit) format4 ->
'aEach 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 () ))These methods take a simple string as input.
method set_level : log_level -> unitSets the log level of the logger instance.