Logger.Output
Log output.
We can have multiple log outputs, they each get a Log_event.t
. See Reporter.to_outputs
to see how to use these.
A log output must be thread-safe, as it will be called from multiple threads.
A log output. It receives Log_event.t
s and writes/sends them somewhere.
val stdout : unit -> t
val stderr : unit -> t
val to_event :
emit_ev:(Log_event.t -> unit) ->
flush:(unit -> unit) ->
unit ->
t
val to_str : emit_str:(string -> unit) -> flush:(unit -> unit) -> unit -> t
val to_chan : ?autoflush:bool -> out_channel -> t
Write into the channel, as text.
val to_chan_jsonl : ?autoflush:bool -> out_channel -> t
Write into the channel as jsonl.
val buf_pool : Stdlib.Buffer.t Imandrakit.Apool.t
Buffer pool for loggers. Please hold onto buffers for only a short period of time.