30 lines
597 B
OCaml
30 lines
597 B
OCaml
|
type logger
|
||
|
|
||
|
type level =
|
||
|
| TRACE
|
||
|
| DEBUG
|
||
|
| INFO
|
||
|
| WARN
|
||
|
| ERROR
|
||
|
|
||
|
(* log_function (fun m -> m "<fmt>" <args>); *)
|
||
|
type 'a log_function =
|
||
|
((('a, Format.formatter, unit) format -> 'a) -> unit) -> unit
|
||
|
|
||
|
module type Logs = sig
|
||
|
val logger : logger
|
||
|
val trace : _ log_function
|
||
|
val debug : _ log_function
|
||
|
val info : _ log_function
|
||
|
val warn : _ log_function
|
||
|
val error : _ log_function
|
||
|
val log : level -> _ log_function
|
||
|
end
|
||
|
|
||
|
val logs : string -> (module Logs)
|
||
|
val sublogs : logger -> string -> (module Logs)
|
||
|
|
||
|
val init_pretty_writer :
|
||
|
?min_level:level
|
||
|
-> out_channel -> unit
|