package eio

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

eio-1.5.tbz
sha256=7d70d1f5fb2b7190bf1ab28fffeb272da51ffe6d6c9c7c94e0485fabdf3b3fda
sha512=4582ac2fb2f8616b3d8ae9670eb7913a78085899b14044408801b30a34fed6c4d32971ba72eedb0cbc3d82c057610cf81c482090e75e2985330fcde96478ac5e

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.