jon.recoil.org

Module Ppx_log_kernel.Tag_data

type t =
  1. | Constant of Ppxlib.constant
  2. | Type_constrained of Ppxlib.expression * Ppxlib.core_type
  3. | String_expression of Ppxlib.expression
  4. | Here_extension

Represents the data of a tag in a statement. For example, in

{|[%log.global "message" ~label1:"tag1" ~label2:(tag2 : int) ~label3:tag3 [%here]]|}

"tag1" would be a Constant (tag2 : int) would be Type_constrained tag3 would be a String_expression %here would be a Here_extension

val render : Ppx_log_kernel.Tag_data.t Ppxlib.loc -> label_is_optional:Base.bool -> [ `Tag | `Tag_option ] * Ppxlib.expression

Renders the tag into an expression either of type Log_tag.t or type Log_tag.t option, depending on the attributes (@sexp.option and @sexp.omit_nil).

Example output: Int 123 for constant tags, Sexp ([%sexp_of: typ] expr) for types that aren’t specially handled