package easy_logging
Class Logging.loggerSource
Attributes
Name of the logger:
- can be displayed in log messages.
- defines the logger place in the logging tree.
val mutable level : log_level optionValue used to filter log messages.
val parent : logger optionThe optional parent of this logger.
Whether messages passed to this logger are propagated to its ancestors' handlers.
The list of functions used for dynamic tagging of messages
Classic logging Methods
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:string list -> ('a, unit, string, unit) format4 -> 'amethod error : 'a. ?tags:string list -> ('a, unit, string, unit) format4 -> 'amethod warning : 'a. ?tags:string list ->
('a, unit, string, unit) format4 ->
'amethod info : 'a. ?tags:string list -> ('a, unit, string, unit) format4 -> 'amethod trace : 'a. ?tags:string list -> ('a, unit, string, unit) format4 -> 'amethod debug : 'a. ?tags:string list -> ('a, unit, string, unit) format4 -> 'aLazy logging methods
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 () ))String logging methods
Each of these methods takes a string as an input (as well as the optional tag list.
Example:
logger#sdebug string_variableOther methods
method set_level : log_level -> unitSets the log level of the logger instance.
Will add a tag to each log message, resulting from the call of the supplied fonction (called each time a message is logged)
Sets the propagate attribute, which decides whether messages passed to this logger are propagated to its ancestors' handlers.
Internal methods
method effective_level : log_levelReturns this logger level if it is not None, else searches amongst ancestors for the first defined level; returns NoLevel if no level can be found.