Module Log


module Log: sig .. end
Message logging.


A mechanism for logging messages. Messages are logged with a level, and the module has a notion of the current log level. If a message is logged at the current current log level, or lower, then it will be output.

The default log level is 0, only messages logged at level 0 are output.

The default output destination is Format.std_formatter.

val set_log_formatter : Format.formatter -> unit
Set the output destination for messages
val set_log_level : int -> unit
Set current log level
Raises Invalid_argument "negative level" if you attempt to set the current log level to a negative value
val log : (Format.formatter -> 'a -> unit) -> int -> 'a -> unit
Log.log print level x outputs x using print, if level <= current log level
Raises Invalid_argument "negative level" if level < 0
val log_int : int -> int -> unit
Log.log_int level i logs i, if level <= current log level
Raises Invalid_argument "negative level" if level < 0
val log_float : int -> float -> unit
Log.log_float level j logs j, if level <= current log level
Raises Invalid_argument "negative level" if level < 0
val log_string : int -> string -> unit
Log.log_string level s logs s, if level <= current log level
Raises Invalid_argument "negative level" if level < 0
val log_bool : int -> bool -> unit
Log.log_bool level b logs b, if level <= current log level
Raises Invalid_argument "negative level" if level < 0
val log_time : int -> Time.time -> unit
Log.log_time level t logs seconds of processor time since t, if level <= current log level
Raises Invalid_argument "negative level" if level < 0
val log_flush : int -> unit -> unit
Log.log_flush level () flushes the log output, if level <= current log level
Raises Invalid_argument "negative level" if level < 0
val log_newline : int -> unit -> unit
Log.log_newline level () outputs a new line and flushes the log output, if level <= current log level
Raises Invalid_argument "negative level" if level < 0

Hosted by the SourceForge.net Logo* web site.
*Other names and brands may be claimed as the property of others.