package trace-tef

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

trace-0.4.tbz
sha256=b51ec546ec1c90f6ed60b330ea7c9212d5c9c26e4d93e38e60224d984fab09b1
sha512=dc617857b0f213765b82b45281ebef2fab4b8c213597f19cf4476356e2c7295c3aeb0d71c8d1954617196d7c491336efba1c67f02138d011ac590053c06ed638

doc/trace-tef/Trace_tef/index.html

Module Trace_tefSource

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

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

Sourcetype output = [
  1. | `Stdout
  2. | `Stderr
  3. | `File of string
]

Output for tracing.

  • `Stdout will enable tracing and print events on stdout
  • `Stderr will enable tracing and print events on stderr
  • `File "foo" will enable tracing and print events into file named "foo"
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. since 0.2 a () argument was added.

OCaml

Innovation. Community. Security.