package async_log

  1. Overview
  2. Docs

Module Async_log_kernel.Message_eventSource

Sourcetype t

A t represents a log message with additional structured information about the statement, for use by outputs. Most outputs flatten the event to a Message.t, which predates this module and is serializable / deserializable, but has less structured information.

(This module's signature is tight / bare to keep the type extensible and backwards-compatible with previous behaviour, but this isn't intended to deter any users who may wish for an accessor to be added, especially for newer structured info in Message_sexp.t.)

Sourceval create : ?time:Core.Time_float.t -> ?source:string -> ?legacy_tags:(string * string) list -> ?level:Level.t -> Ppx_log_types.Message_data.t -> t
Sourceval message : t -> string
Sourceval legacy_tags : t -> (string * string) list
Sourceval level : t -> Level.t option
Sourceval add_tags : t -> tags:(string * string) list -> t
Sourceval map_legacy_tags : t -> f:((string * string) -> string * string) -> t
Sourceval stringify_message_and_map : t -> f:(string -> string) -> t

Convert any structured messages to a string and map. The structured format is not recovered afterwards. This is mainly used for convenience in testing outputs.

Sourceval downgrade_to_unstructured_and_map : t -> f: ([ `Sexp of Core.Sexp.t | `String of string ] -> [ `Sexp of Core.Sexp.t | `String of string ]) -> t

Convert any structured messages to the unstructured sexp format and map. The structured format is not recovered afterwards.

This is used by old code that predates the structured messages, often to censor certain fields out of log messages.

Sourceval set_level : t -> level:Level.t option -> t
Sourceval to_serialized_message_lossy : t -> Message.t
Sourceval of_serialized_message : Message.t -> t
Sourcemodule Unstable : sig ... end
Sourcemodule Private : sig ... end
OCaml

Innovation. Community. Security.