package async_log
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=2dae248d74c23aa6a1e0bc38d5b34c975eb4dfbdf32f0970641b5befd8385720
doc/async_log.kernel/Async_log_kernel/Message_event/index.html
Module Async_log_kernel.Message_event
Source
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
.)
val create :
?time:Core.Time_float.t ->
?source:string ->
?legacy_tags:(string * string) list ->
?level:Level.t ->
Ppx_log_types.Message_data.t ->
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.
val 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.