Module Log

module Log: sig .. end
This module provides error reporting functions for Mezzo. Any module can use it.

exception MzInternalFailure of string
val enable_debug : int -> unit
Enable debugging information. You should provide a debugging level. The higher the level, the more verbose the information. Currently, verbosity levels range from 0 (no debug messages) to 4 (all debug messages).
val debug_level : unit -> int
val debug : ?level:int -> ('a, Buffer.t, unit, unit) Pervasives.format4 -> 'a
Report some debugging information. Use it like Printf.printf
val warn : ('a, Buffer.t, unit, unit) Pervasives.format4 -> 'a
A warning is a message that always appears, even when debug is disabled.
val error : ('a, Buffer.t, unit, 'b) Pervasives.format4 -> 'a
Report a fatal error. For now, this raises an exception, but it might do better in the future. Use it like Printf.printf.
val msg : ('a, Buffer.t, unit, string) Pervasives.format4 -> 'a
Analogous to error, but does not raise any exception; instead, just produces and returns the error message as a string.
val check : bool -> ('a, Buffer.t, unit, unit) Pervasives.format4 -> 'a
Assert something, otherwise display an error message and fail
val raise_level : int -> (unit -> 'a) -> 'a
Perform an operation with the debug level raised by an amount.
val silent : (unit -> 'a) -> 'a
Perform an operation with the debug output disabled.

/ *
val warn_count : int Pervasives.ref