package trace

  1. Overview
  2. Docs

Trace subscribers

type t =
  1. | Sub : {
    1. st : 'st;
    2. callbacks : 'st Callbacks.t;
    } -> t

A trace subscriber. It pairs a set of callbacks with the state they need (which can contain a file handle, a socket to write events to, config, etc.).

The design goal for this is that it should be possible to avoid allocations whenever the trace collector invokes the callbacks.

val dummy : t

Dummy subscriber that ignores every call.

val tee : t -> t -> t

tee s1 s2 is a subscriber that forwards every call to s1 and s2 both.

val tee_l : t list -> t

Tee multiple subscribers, ie return a subscriber that forwards to all the subscribers in subs.

OCaml

Innovation. Community. Security.