Module Connector.Log

Connector log messages.

This is a suggested log message format for connectors. They can be emitted by connectors to track activity and report unexpected events.

type dur_ns = int64

The type for integer nanosecond duration.

type msg = [
  1. | `Service_exn of exn * Stdlib.Printexc.raw_backtrace
  2. | `Connector_exn of exn * Stdlib.Printexc.raw_backtrace
  3. | `Connection_reset
  4. | `Trace of dur_ns * Request.t option * Response.t option
]

The type for connector log messages.

val pp_msg : Stdlib.Format.formatter -> msg -> unit

pp_log_msg is a unspecified formatter for log messages.

val quiet : msg -> unit

quiet is Fun.const ().

val default : ?ppf:Stdlib.Format.formatter -> trace:bool -> unit -> msg -> unit

default_log ~ppf ~trace logs message on ppf (defaults to Format.err_formatter) and `Trace messages iff trace is true.