package dolog

  1. Overview
  2. Docs

Module Dolog.LogSource

Logger

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

Signature for the functor parameters.

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