Legend:
Library
Module
Module type
Parameter
Class
Class type
A library for general logging.
Although this module is fully Async-safe it exposes almost no Deferreds. This is partially a design choice to minimize the impact of logging in code, and partially the result of organic design (i.e., older versions of this interface did the same thing).
A (limited) Blocking module is supplied to accommodate the portion of a program that runs outside of Async.
Async programs often have a non-Async portion that runs before the scheduler begins to capture command line options, do setup, read configs, etc. This module provides limited global logging functions to be used during that period. Calling these functions after the scheduler has started will raise an exception. They otherwise behave similarly to the logging functions in the Async world.
Programs that want simplistic single-channel logging can open this module. It provides a global logging facility to a single output type at a single level. More nuanced logging can be had by using the functions that operate on a distinct Log.t type.
val set_on_error : t->[ `Raise | `Call of Core.Error.t-> unit ]-> unit
If `Raise is given, then background errors raised by logging will be raised to the monitor that was in scope when create was called. Errors can be redirected anywhere by providing `Call f.
surround t message f logs message and a UUID once before calling f and again after f returns or raises. If f raises, the second message will include the exception, and surround itself will re-raise the exception tagged with message. As usual, the logging happens only if level exceeds the minimum level of t.