Imandrakit_log.Logger
Main logger
type level = Log_level.t
val pp_level :
Ppx_deriving_runtime.Format.formatter ->
level ->
Ppx_deriving_runtime.unit
val show_level : level -> Ppx_deriving_runtime.string
val equal_level : level -> level -> Ppx_deriving_runtime.bool
module Log_event = Log_event
module Output : sig ... end
Log output.
val shutdown : t -> unit
val as_reporter : t -> Logs.reporter
val events : t -> Log_event.t Imandrakit.Observer.t
val null : unit -> t
with_no_logger () f
calls f()
in a context where there is no logger. Useful to avoid logging loops.
Setup log level. It will use Info
by default, unless the env var "DEBUG"
is set or ~debug
or ~log_level
is passed.
debug
takes precedence over log_level
which takes precedence over the env.
Setup a logger that emits into the file specified in filename
or in "LOG_FILE"
env, or no logger otherwise. This will cleanup at the end when the function returns.
module type LOG = sig ... end
val mk_log_str : string -> (module LOG)
Create a new logger with the given source.