package eio

  1. Overview
  2. Docs
Effect-based direct-style IO API for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

eio-0.14.tbz
sha256=52f85b947d3e0de70940b5bbaac0d3e78841fea5648e73af7d8a754ab51c871b
sha512=944095b1131d2dcc1f0d415fe46fd78b883733e0f95985e3a0feafe73b1703606ec60560abf36c16c364cc60164b7330f236e39569e264c702bb5647e28bfd3c

doc/eio/Eio/Debug/index.html

Module Eio.DebugSource

Control over debugging.

Example:

  open Eio.Std

  let my_traceln = {
    Eio.Debug.traceln = fun ?__POS__:_ fmt -> Fmt.epr ("[custom-trace] " ^^ fmt ^^ "@.")
  }

  let () =
    Eio_main.run @@ fun env ->
    let debug = Eio.Stdenv.debug env in
    Fiber.with_binding debug#traceln my_traceln @@ fun () ->
    traceln "Traced with custom function"

This will output:

 [custom-trace] Traced with custom function 
Sourcetype traceln = Private.Debug.traceln = {
  1. traceln : 'a. ?__POS__:(string * int * int * int) -> ('a, Format.formatter, unit, unit) format4 -> 'a;
}

A function that writes trace logging to some trace output.

It must not switch fibers, as tracing must not affect scheduling. If the system is not ready to receive the trace output, the whole domain must block until it is.

Sourceval with_trace_prefix : (Format.formatter -> unit) -> (unit -> 'a) -> 'a

with_trace_prefix fmt fn runs fn () with a traceln that outputs fmt before each message.

Sourcetype t = < traceln : traceln Fiber.key >

Fiber keys used to control debugging. Use Stdenv.debug to get this.

OCaml

Innovation. Community. Security.