dolog

The dumb OCaml logging library
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library dolog
Module Dolog . Log

Logger

Log levels
type log_level =
| FATAL
| ERROR
| WARN
| INFO
| 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
val set_prefix_builder : ( log_level -> string ) -> unit
val get_prefix_builder : unit -> log_level -> string
val short_prefix_builder : log_level -> string

Ready-to-use short timestamp builder

Printf-like logging primitives
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 =
| Black
| Red
| Green
| Yellow
| Blue
| Magenta
| Cyan
| White
| Default
val color_on : unit -> unit
val color_off : unit -> unit
val set_color_mapping : ( log_level -> color ) -> unit