package cohttp-lwt-unix

  1. Overview
  2. Docs
CoHTTP implementation for Unix and Windows using Lwt

Install

Dune Dependency

Authors

Maintainers

Sources

cohttp-v6.0.0_beta2.tbz
sha256=90ecec8bd580411b4272c031b2f6b9c0a50485d20683c6a9c615242f3724b017
sha512=83ef539469d982862174a929e9baeb5b2a34e9323ee577d8be7148ebed9e785d835d59cc22982bc083bb872e4544616e2bf531ed7edf96bc397151c28bf618d6

doc/cohttp-lwt-unix/Cohttp_lwt_unix/Debug/index.html

Module Cohttp_lwt_unix.DebugSource

Debugging output for Cohttp Unix

Sourceval default_reporter : Logs.reporter

default_reporter provides a simple reporter that sends the logging output to stderr. For example, the code below enables logging at level level to stderr, using coloured output if possible.

  Fmt_tty.setup_std_outputs ();
  Logs.set_level ~all:true (Some level);
  Logs.set_reporter Debug.default_reporter
Sourceval activate_debug : unit -> unit

activate_debug enables debugging output that will be sent to standard error.

Sourceval debug_active : unit -> bool

debug_active returns true if activate_debug has been called and false otherwise

Selectively disable cohttp logging

It is possible to selectively disable cohttp internal logginb by filtering over the various modules logs names as follows.

  (* Set log level v for all loggers, this does also affect cohttp internal loggers *)
  Logs.set_level ~all:true level;
  (* Disable all cohttp-lwt and cohttp-lwt-unix logs *)
  List.iter (fun src ->
      match Logs.Src.name src with
      | "cohttp.lwt.io" | "cohttp.lwt.server" -> Logs.Src.set_level src None
      | _ -> ())
  @@ Logs.Src.list ()
OCaml

Innovation. Community. Security.