package vlt

  1. Overview
  2. Docs

This module defines the various levels of log, as well as some utility functions over levels.

type error =
  1. | Invalid_level_string of string
  2. | Invalid_level_int of int
exception Exception of error
type t =
  1. | FATAL
    (*

    Level for errors leading to program termination.

    *)
  2. | ERROR
    (*

    Level for errors handled by the program.

    *)
  3. | WARN
    (*

    Level for for hazardous circumstances.

    *)
  4. | INFO
    (*

    Level for coarse-grained information.

    *)
  5. | DEBUG
    (*

    Level for debug information.

    *)
  6. | TRACE
    (*

    Level for fine-grained information.

    *)

The type of logging levels.

val levels : t list

The list of all levels, in ascending order (i. e. from FATAL to TRACE).

val to_string : t -> string

Converts the passed level into a string.

val of_string : string -> t

Converts the passed string into a level. The string is converted from its uppercase form.

Raises Exception if the passed string is not valid.

val to_int : t -> int

Converts the passed level into an integer.

val of_int : int -> t

Converts the passed integer into a level.

Raises Exception if the passed integer is not valid.