Module Log

module Log: sig .. end
A library for general logging.

Although this module is fully async-safe it exposes almost no Deferreds. This is partially a design choice to minimize the impact of logging in code, and partially the result of organic design (i.e. older versions of this interface did the same thing).

A (limited) Blocking module is supplied in Global to accomodate the portion of a program that runs outside of Async.


module Level: sig .. end
module Message: sig .. end
module Rotation: sig .. end
module Output: sig .. end
module Blocking: sig .. end
type t 
module type Global_intf = sig .. end
module Make_global: 
functor (Empty : sig
end) -> Global_intf
module Global: Global_intf 
val set_level : t -> Level.t -> unit
set_level sets the level of the given log. Messages sent at a level less than the current level will not be output.
val set_output : t -> Output.t list -> unit
set_output changes the output type of the log, which can be useful when daemonizing. The new output type will be applied to all subsequent messages.
val close : t -> unit
close closes a log so that further write attempts will raise an error.
val flushed : t -> unit Import.Deferred.t
flushed returns a Deferred.t that is fulfilled when the last message delivered to t before the call to flushed is out the door.
val create : level:Level.t -> output:Output.t list -> t
create create a new log
val raw : ?tags:(string * string) list ->
t -> ('a, unit, string, unit) Pervasives.format4 -> 'a
raw printf like logging for raw (no level) messages. Raw messages are still output with a timestamp.
val debug : ?tags:(string * string) list ->
t -> ('a, unit, string, unit) Pervasives.format4 -> 'a
debug printf like logging at the `Debug log level
val info : ?tags:(string * string) list ->
t -> ('a, unit, string, unit) Pervasives.format4 -> 'a
info printf like logging at the `Info log level
val error : ?tags:(string * string) list ->
t -> ('a, unit, string, unit) Pervasives.format4 -> 'a
error printf like logging at the `Error log level
val printf : ?tags:(string * string) list ->
?level:Level.t ->
t -> ('a, unit, string, unit) Pervasives.format4 -> 'a
printf generalized printf style logging
val sexp : ?tags:(string * string) list ->
?level:Level.t -> t -> 'a -> ('a -> Core.Std.Sexp.t) -> unit
sexp logging of values without first converting them to a string. In the case where the log level would discard this message no conversion will ever be done.
val of_lazy : ?tags:(string * string) list ->
?level:Level.t -> t -> string Core.Std.Lazy.t -> unit
of_lazy logging of lazy values. In the case where the log level would discard this message no evaluation will ever be forced.
val message : t -> Message.t -> unit
module Reader: sig .. end