package miaou-core

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Miaou_interfaces.Logger_capabilitySource

Logger capability: application-provided logging API for Miaou.

The core emits log messages through this capability. Implementations should support at least the provided levels, and may choose to decorate, filter, or persist messages (console, rotating file, system logger, etc.). The set_logfile function allows callers to request a log file path; the implementation may open, rotate, or reject the request.

Example

  let logf level msg = Printf.eprintf "%s: %s\n" (match level with Debug->"DBG"|Info->"INF"|Warning->"WRN"|Error->"ERR") msg in
  let set_enabled _ = () in
  let set_logfile = fun _ -> Ok () in
  Miaou_core.Logger_capability.set { logf; set_enabled; set_logfile }
Sourcetype level =
  1. | Debug
  2. | Info
  3. | Warning
  4. | Error
Sourcetype t = {
  1. logf : level -> string -> unit;
  2. set_enabled : bool -> unit;
  3. set_logfile : string option -> (unit, string) result;
}
Sourceval set : t -> unit
Sourceval get : unit -> t option
Sourceval require : unit -> t