package eio

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

eio-0.11.tbz
sha256=0c33742074562631677886f4fe4a02f9672cec94297ff85c2ed854db5baa71aa
sha512=590843cb5fb3906fd5ab9911d29206172d164a53c48e635871a23c95d4cdce8ae0999480471187fdddee8c9c523148911ca140feabde6a826c317671a3b33090

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.

Sourcetype t = < traceln : traceln Fiber.key >

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