package devkit
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=a39dbbce04bd5562a9b4443daf39c582
sha512=b10104b61384b2151521b785e7f3c3250134c75eae09b42cad69bc4a22a9a5e429beb891ee87cedf376c23d9c40f09d3f71c3fd48aa35df490c0f69dc17f3242
doc/devkit.core/Devkit_core/Log/index.html
Module Devkit_core.LogSource
Global ready-to-use logger
TODO interface to manage State
Example usage
Create logging facility (messages origin)
let http = Log.facility "http"Log from http subsystem at debug level
Log.debug http "received %u bytes"Create and use object for http logging
let log = Log.from "http" (* new Log.logger http *);;
log#info "sent %u bytes" 1024
log#warn ~exn "failed here"Output only messages of warning level or higher for the http facility
http#allow `Warnor
Logger.set_filter http `Warnor
Log.set_filter ~name:"http" `Warnor
Log.set_filter ~name:"http*" `Warnto set for all facilities starting with "http"
Output only messages of warning level or higher for all facilities
Log.set_filter `WarnAPI
Update facilities configuration from the environment.
By default, it reads the configuration in the environment variable DEVKIT_LOG which can be overwritten using the optional process_name parameter.
The value of environment variable should match the following grammar: ([<facil|prefix*>=]debug|info|warn|error|critical[,])*
type 'a pr =
?rate_limit:Control.Rate_limit.t ->
?exn:exn ->
?lines:bool ->
?backtrace:bool ->
?saved_backtrace:string list ->
?ts:Time.t ->
?structured_pairs:Logger.Pairs.t ->
?pairs:Logger.Pairs.t ->
('a, unit, string, unit) format4 ->
'aparam lines: whether to split multiline message as separate log lines (default true)
param backtrace: whether to show backtrace if exn is given (default is false)
param saved_backtrace: supply backtrace to show instead of using Printexc.get_backtrace
param pairs key/value pairs to add to the line, unconditionally
param structured_pairs key/value pairs to use for structured log formats only. Plain logging will discard.
Default rate limiter, shared between all the loggers
reopen log file