package easy_logging_yojson
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Configuration loader for easy_logging with yojson backend
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.8.2.tar.gz
md5=467a966433b97693e0c226a90b9b833e
sha512=d4b97a29225c454a2d8ed04495aa7ecd3b012d7258372be2450e9b672498ba24ce9a3079307e762e12948661bc1e104a90f167fabf60c212fe67b13d6c4edf51
doc/index.html
Easy logging yojson
This package provides the same features as Easy_logging, but is extended with configuration loader from the json format, using ppx_deriving_yojson as a deserializer.
Logging modules created by MakeLogging are enriched with the three following functions to instantiate loggers and allow easy external configuration :
val load_config : Yojson.Safe.json -> unitval load_config_str : string -> unitval load_config_file : string -> unit
Configuration example
{
"handlers": {
"file_handlers": {
"logs_folder" : "logs",
"truncate" : false
}
},
"loggers":
[
{
"name": "Main",
"level": "debug",
"handlers": [ {"cli": {"level" : "debug"}} ] },
{
"name": "Main.A",
"level": "info"},
{
"name": "Main.B",
"level": "warning"},
{
"name": "Main.C",
"level": "debug",
"propagate" : false,
"handlers": [{ "file": {"filename": "main.c.logs",
"level" : "info"}}
] }
]
}Configuration types
Top configuration
type config = {
handlers : H.config; [@default H.default_config]
loggers : config_logger list
} Logger configuration
type config_logger = {
name: string;
level : log_level; [@default NoLevel]
handlers : H.desc list; [@default [] ]
propagate : bool; [@default true]
} Default handlers configuration
type config_ = {file_handlers: file_handlers_config}
type file_handlers_config_ =
{ logs_folder: string; [@default file_handlers_defaults.logs_folder]
truncate: bool; [@default file_handlers_defaults.truncate]
file_perms: int [@default file_handlers_defaults.file_perms]
}
type cli_json_params = {level : log_level}
type cli_json_desc = {cli : cli_json_params}
type file_json_desc_params = {filename : string;level: log_level}
type file_json_desc = {file : file_json_desc_params}
Reference
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page