package dolog

  1. Overview
  2. Docs

Logger

Log levels
type log_level =
  1. | FATAL
  2. | ERROR
  3. | WARN
  4. | INFO
  5. | DEBUG
val string_of_level : log_level -> string
val level_of_string : string -> log_level
Setup
val set_log_level : log_level -> unit
val get_log_level : unit -> log_level
val set_output : out_channel -> unit
val set_prefix : string -> unit
val clear_prefix : unit -> unit
Printf-like logging primitives
module type S = sig ... end
include S
val log : log_level -> ('a, out_channel, unit, unit) format4 -> 'a
val fatal : ('a, out_channel, unit) format -> 'a
val error : ('a, out_channel, unit) format -> 'a
val warn : ('a, out_channel, unit) format -> 'a
val info : ('a, out_channel, unit) format -> 'a
val debug : ('a, out_channel, unit) format -> 'a
Coloring of log levels (optional)
type color =
  1. | Black
  2. | Red
  3. | Green
  4. | Yellow
  5. | Blue
  6. | Magenta
  7. | Cyan
  8. | White
  9. | Default
val color_on : unit -> unit
val color_off : unit -> unit
val set_color_mapping : (log_level -> color) -> unit
Functor interface (optional)
module type SECTION = sig ... end

Signature for the functor parameters.

module Make (Section : SECTION) : S

This module aims to be used on the first line of each module: module Log = Log.Make(struct let section = "module-name" end)

OCaml

Innovation. Community. Security.