package easy_logging

  1. Overview
  2. Docs
Module to log messages. Aimed at being both powerful and easy to use

Install

Dune Dependency

Authors

Maintainers

Sources

v0.6.1
md5=e4e71624902c7c06c75da8314287b0b7
sha512=415b5ef14d05173c28acbec467cf5a6906fce5dd244658fbee7673cc516d23c0aa069984330befe85270b708af070e40275eb1c2e78bdf8f717116454c237d0c

Description

Logging infrastructure inspired by the Python logging module. The aim of this module is to provide a quick and easy to use logging infrastructure.

It has the following features :

  • one line logger creation
  • log messages printf style, or [string] or [string lazy_t]
  • tree logging architecture for light configuration
  • handlers associated to each logger will format, filter and treat the message independantly.
  • use the infrastructure with your own handlers with the [MakeLogging] functor.
  • use tags to add contextual information to log messages

Published: 27 Sep 2019

README

README.md

Logging module for OCaml.

Quick start :

open Easy_logging
logger = Logging.make_logger "my_logger" Debug [Cli Debug];;
logger#info "log_message";;

See documentation at https://sapristi.github.io/easy_logging/easy_logging

Changelog

Version 0.4

  • printf style logging is now the default

  • simplifed configuration in case of multiple loggers (and closer to the python module) : the loggers form a tree (based on their name, dots indicating descendence)

    • log items are passed to the handlers of a logger’s ancestors (so that few handlers need initialisation) (possible to override)

    • loggers inherit the level of their ancestor if not set explicitely

  • an additional package easy_logging_yojson provides initialisation of loggers from the json format (with ppx_deriving_yojson), so that configuration can be fully done outside the code.

Version 0.5

  • Renamed the Default_handlers module to handlers

  • tag type in Handlers is now string (was unit)

  • added the possibility to add filters to handlers

  • added tag_generator feature to loggers, to automatically add tags to all messages passed to a logger

version 0.5.1
  • log_level type is direcly accessible from Easy_logging and Easy_logging_yojson modules

version 0.5.2
  • more file_handler options (timestamp, versioning)

Dependencies (3)

  1. calendar >= "2.0"
  2. dune >= "1.8"
  3. ocaml >= "4.04.0"

Dev Dependencies

None

Used by (2)

  1. easy_logging_yojson = "0.6.0"
  2. little_logger < "0.3.0"

Conflicts

None