package async_log

  1. Overview
  2. Docs

Async programs often have a non-Async portion that runs before the scheduler begins to capture command line options, do setup, read configs, etc. This module provides limited global logging functions to be used during that period. Calling these functions after the scheduler has started will raise an exception. They otherwise behave similarly to the logging functions in the Async world.

There are more detailed comments for the API below near the non-blocking signatures.

module Output : sig ... end
val level : unit -> Async_log_kernel.Level.t
val set_level : Async_log_kernel.Level.t -> unit
val set_output : Output.t -> unit
val set_time_source : Async_kernel.Synchronous_time_source.t -> unit
val set_transform : (Message.t -> Message.t) option -> unit
val raw : ?time:Core.Time_float.t -> ?tags:(string * string) list -> ('a, unit, string, unit) Core.format4 -> 'a
val info : ?time:Core.Time_float.t -> ?tags:(string * string) list -> ('a, unit, string, unit) Core.format4 -> 'a
val error : ?time:Core.Time_float.t -> ?tags:(string * string) list -> ('a, unit, string, unit) Core.format4 -> 'a
val debug : ?time:Core.Time_float.t -> ?tags:(string * string) list -> ('a, unit, string, unit) Core.format4 -> 'a
val printf : ?level:Async_log_kernel.Level.t -> ?time:Core.Time_float.t -> ?tags:(string * string) list -> ('a, unit, string, unit) Core.format4 -> 'a
val raw_s : ?time:Core.Time_float.t -> ?tags:(string * string) list -> Core.Sexp.t -> unit
val info_s : ?time:Core.Time_float.t -> ?tags:(string * string) list -> Core.Sexp.t -> unit
val error_s : ?time:Core.Time_float.t -> ?tags:(string * string) list -> Core.Sexp.t -> unit
val debug_s : ?time:Core.Time_float.t -> ?tags:(string * string) list -> Core.Sexp.t -> unit
val sexp : ?level:Async_log_kernel.Level.t -> ?time:Core.Time_float.t -> ?tags:(string * string) list -> Core.Sexp.t -> unit
OCaml

Innovation. Community. Security.