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.
type capture_meta_hook = unit -> (string * Log_meta.t) list
A metadata capture hook, returning a list of metadata
val add_capture_meta_hook : capture_meta_hook -> unit
Add a global hook, called at logging point to capture metadata from the ambient context.
val add_rich_tag : 'a Logs.Tag.def -> ('a -> Log_meta.t) -> unit
Special tag that we convert to a Log_meta.t
instead of just a string
val shutdown : t -> unit
val as_reporter : t -> Logs.reporter
val events : t -> Log_event.t Imandrakit.Observer.t
val null : unit -> t
val emit_ev : t -> Log_event.t -> unit
emit_ev logger ev
emits the log event through all of logger
's outputs
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.
val all_sources_str : string Iter.t
Parse a logging command, ie a list of "src=level" separated by ","
val setup_level_per_source_str : string -> (unit, string) result
Parse a logging command from the string, and apply it.