package devkit
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=47338eaae436aba40abd4d194ee40054
sha256=499b050b73643f6ad7349a41485539d4166d149a07fba59cb6841f508c0297f8
sha512=6a5bf77061d390ddb331ed3d5891a5c56502be91f0eff6846202f658ebfa97ef57695d7a192cbdad4c7b8835f5665df3ea4375daf46930334ebbd9a07f00feca
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[,])*
type 'a pr =
?exn:exn ->
?lines:bool ->
?backtrace:bool ->
?saved_backtrace:string list ->
('a, unit, string, unit) format4 ->
'aparam lines: whether to split multiline message as separate log lines (default true)
param backtrace: whether to show backtrace (default is true if exn is given and backtrace recording is enabled)
param saved_backtrace: supply backtrace to show instead of using Printexc.get_backtrace
reopen log file