[ANN] Release of Easy_logging v0.6

I’m glad to announce the release of Easy_logging v0.6.

Easy_logging is a logging library inspired from the python logging module, which allows fine grained tuning of log levels and log output, with relatively low configuration, and simple logger declaration and usage.

The most important new features are

  • auto-timestamp and/or versioning of file names when logging to a file
  • redefined handler type, so that custom handlers can easily be defined.
  • handlers support custom filters
  • loggers have tag generators (tags generated from callback functions)
  • log items now contain a timestamp

I also cleaned the API, so that the only exposed objects from opening Easy_logging are the Logging, Handlers and Logging_internals modules.

The documentation is still lagging a bit behind, and will be updated [insert a random date here].

What comes next

  • I plan to drop entirely the support for the MakeLogging functor (that creates a Logging module from a Handlers module), so if anyone depends on it please tell me.
  • Some still lacking options are file-rotation when logging to a file. I guess the saner way to do so would be using Lwt, so I might implement a Lwt version of the module.

PS: I try to maintain a relatively stable external API, but the internals might (and will) change whenever I feel like it.

2 Likes

Could you explain the reasoning for using objects in the design?

The main design goal was to provide simple logger creation and usage; the choice was between objects and modules (via functors), and the objects won :slight_smile:
Functor usage for “basic” tasks seems a bit clumsy to me, and object creation is also more flexible (optional parameters e.g.). The internals would also have been a bit trickier (first class modules).

An « experimental » FileRotating Handler was added in version 0.6.2 of Easy_logging. Behaviour is about the same as the python one, except that rotating parameters (max_kbytes and backup_count) shouldn’t be 0.