module Log: BatLog
val output : unit BatIO.output Pervasives.ref
stderr
val prefix : string Pervasives.ref
typeflag =
[ `Custom of unit -> string | `Date | `Filepos | `Time ]
val flags : flag list Pervasives.ref
`Date; `Time
and log
messages are printed as:
2011/0628 01:23:45: prefixmessage
Since 2.0; had getter and setter in 1.x
val log : ?fp:string -> string -> unit
log s
logs the message s, returning unit.val logf : ?fp:string -> ('a, unit BatIO.output, unit) Pervasives.format -> 'a
Printf.printf
, only the message is printed to the logging
output and prefixed with status information per the current flags and
the currently set prefix.val fatal : ?fp:string -> string -> 'a
fatal s
logs the message s
and then calls exit 1
. This
exits the program with return code 1.val fatalf : ?fp:string -> ('a, unit BatIO.output, unit) Pervasives.format -> 'a
fatalf
allows a format string (as Printf.printf
)and the
arguments to that format string to build the logging message.
Exits the program with return code 1.module type Config =sig
..end
module Make:
fatal
, fatalf
, log
, and
logf
that logs to the given output channel, with given prefix
and flags. These methods work like the corresponding functions in
the BatLog module.val make_logger : 'a BatIO.output ->
string ->
[< `Custom of unit -> string | `Date | `Filepos | `Time ] list ->
< fatal : ?fp:string -> string -> 'b;
fatalf : ?fp:string ->
('c, 'a BatIO.output, unit, unit, unit, 'd) format6 -> 'c;
log : ?fp:string -> string -> unit;
logf : ?fp:string -> ('e, 'a BatIO.output, unit) Pervasives.format -> 'e >
typeeasy_lev =
[ `always | `debug | `error | `fatal | `info | `trace | `warn ]
Easy
loggermodule Easy:sig
..end
module type Level_sig =sig
..end
module Make_lev:
Easy