package cabal

  1. Overview
  2. Docs

Module Cabal.DiagnosticsSource

Backend-owned diagnostics surface.

Backend modules use this API for diagnostic logs and human-facing warnings without depending on Épure application libraries. Applications embedding the backend may install a handler that bridges events into their own logging or UI surface.

Sourcetype level =
  1. | Debug
  2. | Info
  3. | Warn
  4. | Error

Diagnostic severity for backend log events.

Sourcetype event =
  1. | Log of level * string
  2. | User_warning of string

Rendered diagnostic event delivered to the installed handler.

Sourcetype handler = event -> unit

Callback that consumes rendered backend diagnostic events.

Sourceval set_handler : handler -> unit

Install a diagnostics handler.

pre The handler must not raise for normal diagnostic input.

post Subsequent diagnostics are delivered to handler as rendered strings.

iolators}
(none)

{violates}
(none)
Sourceval reset_handler : unit -> unit

Restore the standalone backend default handler.

pre (none)

post Debug/info logs are ignored; warnings/errors and user warnings are written to stderr.

iolators}
(none)

{violates}
(none)
Sourceval log : level -> ('a, unit, string, unit) format4 -> 'a

Emit a formatted backend log event at level.

pre The format string and arguments must be valid for Printf.ksprintf.

post The active handler receives Log (level, rendered_message).

iolators}
(none)

{violates}
(none)
Sourceval debug : ('a, unit, string, unit) format4 -> 'a

Emit a formatted debug log event.

pre The format string and arguments must be valid for Printf.ksprintf.

post The active handler receives a Debug log event.

iolators}
(none)

{violates}
(none)
Sourceval info : ('a, unit, string, unit) format4 -> 'a

Emit a formatted info log event.

pre The format string and arguments must be valid for Printf.ksprintf.

post The active handler receives an Info log event.

iolators}
(none)

{violates}
(none)
Sourceval warn : ('a, unit, string, unit) format4 -> 'a

Emit a formatted warning log event.

pre The format string and arguments must be valid for Printf.ksprintf.

post The active handler receives a Warn log event.

iolators}
(none)

{violates}
(none)
Sourceval error : ('a, unit, string, unit) format4 -> 'a

Emit a formatted error log event.

pre The format string and arguments must be valid for Printf.ksprintf.

post The active handler receives an Error log event.

iolators}
(none)

{violates}
(none)
Sourceval user_warning : ('a, unit, string, unit) format4 -> 'a

Emit a formatted human-facing backend warning.

pre The format string and arguments must be valid for Printf.ksprintf.

post The active handler receives User_warning rendered_message.

iolators}
(none)

{violates}
(none)