Module Log
module Log: sig
.. end
Module that provides methods for logging to
a file or to stdout
.
Author(s): Stefan Wehr, Phillip Heidegger
type
level
type of log levels
val level_full_debug : level
one log level
val level_debug : level
one log level
val level_full_info : level
one log level
val level_info : level
one log level
val level_warn : level
one log level
val level_error : level
one log level
val level_fatal : level
one log level
val level_of_string : string -> level
Converts string into level.
val string_of_level : level -> string
Converts level into string.
val enable_level : level -> unit
enable the given level and all level with
higher priority. If you enable e.g. debug
,
then full_info
, and warn
are also enabled.
val disable_level : level -> unit
disable the level and all levels with lower
priority.
val set_level : level -> unit
val is_enabled : level -> bool
Checks if level is enabled.
val toggle_level : level -> unit
val with_level : level -> (unit -> 'a) -> 'a
run a function and sets for this function
the log level to the given one.
val level_names : string list
list of log level names
val disable_ansi_esc : unit -> unit
Disable the ansi escape sequence usage, if
you log to stdout
.
val disable_ansi_color : unit -> unit
Disable the ansi color escape sequence usage, if
you log to stdout
.
val change_log_target : Pervasives.out_channel -> unit
Change the log target
val add_log_target : Pervasives.out_channel -> unit
add another log target
val open_log_file : string -> Pervasives.out_channel
Open a log file
val full_debug : string Lazy.t -> unit
Full Debug log
val debug : string Lazy.t -> unit
Debug log
val full_info : string Lazy.t -> unit
Full info log
val info : string Lazy.t -> unit
Info log
val warn : string Lazy.t -> unit
Warning log
val error : string -> unit
Error log
val fatal : string -> 'a
Fatal log
exception Log_fatal of string
Exception that is thrown when fatal
is called.