talircd/lib/logging/logging.mli

39 lines
756 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 ->
?color:bool ->
?timestamp:bool ->
?namespace:bool ->
?level:bool ->
out_channel -> unit
val init_journald_writer :
?min_level:level ->
?path:string ->
unit -> unit