package togglelog

  1. Overview
  2. Docs
val logger_name : string
val call : loc:Ppxlib.Location.t -> string option -> Ppxlib_ast.Ast.expression
val build_log : ctxt:Ppxlib.Expansion_context.Extension.t -> ?enabled:bool -> ?log_type:string -> Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression

This does some tricks to guarantee typechecking of the log string. We generate a expression like let _log () = PRINT ... in _log () when printing is enabled, and let _log () = PRINT ... in () when it is disabled.

OCaml

Innovation. Community. Security.