package trace-tef

  1. Overview
  2. Docs
A simple backend for trace, emitting Catapult/TEF JSON into a file

Install

Dune Dependency

Authors

Maintainers

Sources

trace-0.8.tbz
sha256=34cfa5662b611c1e246f0fb8131ee605eeb90b359c105e882f51adc7e70878c3
sha512=ea47974a77a0ab26c58fe6d1bc898d4f3e6a5f865e4c1acb4188b9acd7ba8e7527d0ea7f2ae66574ceccc14f11127ee203aedba2be334d17b36c83dabff61261

doc/trace-tef.tldrs/Trace_tef_tldrs/index.html

Module Trace_tef_tldrsSource

Emit traces by talking to the tldrs daemon

Sourceval collector : out:[ `File of string ] -> unit -> Trace_core.collector

Make a collector that writes into the given output. See setup for more details.

Sourceval subscriber : out:[ `File of string ] -> unit -> Trace_subscriber.t

Make a subscriber that writes into the given output.

  • since 0.8
Sourcetype output = [
  1. | `File of string
]

Output for tracing.

  • `File "foo" will enable tracing and print events into file named "foo". The file is only written at exit.
Sourceval setup : ?out:[ output | `Env ] -> unit -> unit

setup () installs the collector depending on out.

  • parameter out

    can take different values:

    • regular output value to specify where events go
    • `Env will enable tracing if the environment variable "TRACE" is set.
  • If it's set to "1", then the file is "trace.json".
  • If it's set to "stdout", then logging happens on stdout (since 0.2)
  • If it's set to "stderr", then logging happens on stdout (since 0.2)
  • Otherwise, if it's set to a non empty string, the value is taken to be the file path into which to write.
Sourceval with_setup : ?out:[ output | `Env ] -> unit -> (unit -> 'a) -> 'a

with_setup () f (optionally) sets a collector up, calls f(), and makes sure to shutdown before exiting.

OCaml

Innovation. Community. Security.