package easy_logging
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=dea0798a0e16c4c3adcd66284c78f02e
sha512=cec0646fac2c3ef0bca8991053fb0f8867737b6809cb0b191fb806d69df50ddd42fac8dc3147fb5c7f070a8156188fd7f168699189c10a3cbd3d880f81da0fbf
doc/easy_logging/Easy_logging/Logging/class-logger/index.html
Class Logging.logger
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⋅
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: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 ->
'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
These methods take a simple string as input.
Other methods
method set_level : log_level -> unitSets the log level of the logger instance.
method effective_level : log_levelReturs 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.