Module Event

module Event: sig .. end
This module defines the concept of event and how to construct them.

type time 
The type of event timestamps.
type t = private {
   id :int; (*Event identifier.*)
   hostname :string; (*Host name of running program.*)
   process :int; (*Process identifier of running program.*)
   thread :int; (*Thread identifier of event source.*)
   timestamp :time; (*Event timestamp.*)
   relative :int; (*Time elapsed between application start and event construction.*)
   level :Level.t; (*Event level.*)
   logger :Name.t; (*Logger name.*)
   origin :Name.t; (*First logger that received the event.*)
   file :string; (*Location of event source.*)
   line :int; (*Location of event source.*)
   column :int; (*Location of event source.*)
   message :string; (*Event message.*)
   properties :(string * string) list; (*Event properties as an association list from keys to values.*)
   error :(exn * string) option; (*Event error (parameters being actual exception and exception backtrace).*)
}
The type of log events.
val make : Name.t ->
Level.t ->
?origin:Name.t option ->
?file:string ->
?line:int ->
?column:int ->
?properties:(string * string) list -> ?error:exn option -> string -> t
make lg lv ~origin:o ~file:fn ~line:ln ~column:cl ~properties:p ~error:e m constructs a log event for logger lg with level lv, location being defined by fn (filename), ln (line) and cl (column). p is an association list providing user-defined properties, e is an optional exception to be recorded (with its backtrace), and o is the first logger receiving the event (when None, the origin is set to lg). Identifier, thread, timestamp, relative time, and backtrace are automatically generated.
val with_logger : Name.t -> t -> t
with_logger l e returns an event that is identical to e, except that its logger is equal to l.
val bindings : t -> (string * string) list
Returns the bindings for the passed event. The bindings are an association list to be used for event rendering. The following keys are defined: These keys have precedence over the one given at event creation.
val render_bindings : (string * string) list -> string -> string
render_bindings l fmt returns a string representing fmt where all bindings of the association list l have been expanded. Bindings, and their textual format are defined in render.
val render : string -> t -> string
render fmt e returns a string representing fmt where all bindings of e have been expanded. Bindings should appear in fmt is the $(id:pad) format where id is the binding key, and pad the optional padding. The padding consists of whitespace, on the right if pad is positive and on the left otherwise.