package miaou-core

  1. Overview
  2. Docs
Miaou core/widgets (no drivers, no SDL)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.5.2.tar.gz
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6

doc/miaou-core.interfaces/Miaou_interfaces/Logger_capability/index.html

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