package logs-ppx

All checked builds pass
  1. Overview
  2. Docs
PPX to cut down on boilerplate when using Logs

Install

dune-project
 Dependency

Authors

Maintainers

Sources

logs-ppx-0.2.0.tbz
sha256=053f043ef959d6dc079503eab482e91ac1509685d393c4b51f6991c210c0bfb1
sha512=15f5d2f88305bf26c653500f2c883e4774039b2b34a8f7cda3c4e6ae3dcc21939981a23d787e9a89a869c0bd76d0299cdcce2db548df108296f754e8c1584cd3

Description

PPX to remove the closure when logging with Logs. The PPX will still generate the closure which keeps the nice properties of the Logs library.

Added to opam-repository:

README

logs-ppx

A simple ppx to remove some boilerplate when using the excelent Logs library.

Usage

Add this to your dune stanza for your executable

(preprocess
  (pps logs-ppx))

Then you use it like this in OCaml:

[%log debug "Hello %s!" "world"]
(* Which genrates the following *)
Logs.debug (fun m -> m "Hello %s!" "world")

And in Reason it looks like this:

[%log debug("Hello %s!", "world")];
// Which generates the following
Logs.debug(m => m("Hello %s!", "world"));

Thanks

A huge thanks goes to @davesnx for a lot of help and his starter repo

Dependencies (3)

  1. ppxlib
  2. dune >= "2.6"
  3. ocaml >= "4.8.0"

Dev Dependencies (1)

  1. logs with-test

Optional Dependencies

None

Used by (2)

  1. migra
  2. um-abt

Conflicts

None

Build status

Results of building logs-ppx with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.2.0 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure