package easy_logging

  1. Overview
  2. Docs
Module to easily log messages

Install

Dune Dependency

Authors

Maintainers

Sources

rc0.1.5
md5=783d69ec2c9f0fe9a72f3edc8932bb26
sha512=3add23cd44387301f3514083fe7603f15b1530da11d86dc679ca7226b38417dc088d4cec6ea837b641f4af4cbadd3cc991bba68e5dd840d20be63d23eadad740

doc/easy_logging/Easy_logging/Logging/class-logger/index.html

Class Logging.logger

Attributes

val name : string

Name of the logger, displayed in log messages

val mutable levelo : log_level option

Value used to filter log messages. If levelo is None, no message is outputed.

type log_level = | Debug | Info | Warning | Error | Flash 
val mutable handlers : Default_handlers.t list

Registered handlers for this logger

Classic logging Methods

Each of these methods takes a string as an input. If the log level of the instance is low enough, a log item will be created theb passed to the handlers.

Example :

logger#warning "Something wrong happened"
method debug : string -> unit
method info : string -> unit
method warning : string -> unit
method error : string -> unit
method flash : string -> unit

Lazy logging methods

Each of these methods takes a string lazy_t as an input. 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 : string lazy_t -> unit
method linfo : string lazy_t -> unit
method lwarning : string lazy_t -> unit
method lerror : string lazy_t -> unit
method lflash : string lazy_t -> unit

Other methods

method add_handler : Default_handlers.t -> unit

Adds a handler to the logger instance.

method set_level : log_level option -> unit

Sets the log level of the logger instance.

OCaml

Innovation. Community. Security.

On This Page
  1. Attributes