package logs-ppx

  1. Overview
  2. Docs
On This Page
  1. Usage
  2. Thanks
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

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

OCaml

Innovation. Community. Security.