package orsetto

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Diagnostic event journaling (basis).

Overview

This module defines the core module types of a lightweight foundation for diagnostic event journaling, similar to the core Java classes in the Log4j project from the Apache Foundation.

The core interface of the

f_journal

module is functorial, and is intended for extensibility.

Functorial Interface
module type Profile = sig ... end

A profile of diagnostic event journaling module.

module Create (P : Cf_relations.Order) : Profile with type priority := P.t

Use Create(P) to create journaling module with priority ordering P.

Basic Interface
module Basic : sig ... end

A module defining basic diagnostic event journaling with a simple set of priority levels associated to integer priority codes.

class 'level basic_prioritizer : [> Basic.level ] as 'level Basic.prioritizer

The basic prioritizer class, defining the priority codes and message tags for all of the basic priority levels: `Invalid, `Fail, `Error, `Warn, `Info and `Debug. Derive a subclass to define a prioritizer for additional priority levels corresponding to other integer codes.

class 'event basic_channel_archiver : out_channel -> object ... end

The basic channel archiver. Use new basic_channel_archiver c to construct an archiver that emits each basic event e with a priority level less than `Fail to the channel c using Printf.fprintf c "%s: %s\n" e#prioritizer#tag e#message.

class virtual 'archiver basic_agent : 'level basic_prioritizer -> 'level -> 'archiver list -> object ... end

The basic journaling agent. Derive a subclass to define an agent that can construct events derived from the basic event (which may also require archivers derived from the basic archiver that can format any additional required output). The class defines six public methods for output of diagnostic events, one for each basic priority level.

The type of the most basic agent, used for stdout and stderr below.

val stdout : t

A basic agent, initially set with a limit of `Notice, and with with one basic archiver for the Pervasives.stdout channel.

val stderr : t

A basic agent, initially set with a limit of `Notice, and with with one basic archiver for the Pervasives.stderr channel.

OCaml

Innovation. Community. Security.