Module Logs.Tag
Message tags.
Message tags are arbitrary named and typed values that can be associated to log messages. See an example.
Tag definitions
type 'a defThe type for tag definitions. The type
'ais the type of the tag. The definition specifies a name for the tag, a pretty-printer for the type of the tag and a documentation string. Seedef.
val def : ?doc:string -> string -> (Stdlib.Format.formatter -> 'a -> unit) -> 'a defdef ~doc name ppis a tag definition.nameis the name of the tag, it doesn't need to be unique.ppis a printer for the type of the tag.docis a documentation string describing the tag (defaults to"undocumented").
val name : 'a def -> stringname disd's name.
val doc : 'a def -> stringdoc disd's documentation string.
val printer : 'a def -> Stdlib.Format.formatter -> 'a -> unitprinter disd's type pretty-printer.
val pp_def : Stdlib.Format.formatter -> 'a def -> unitpp_def ppf dprints an unspecified representation ofdonppf.
val list : unit -> def_e listtag_list ()is the list of currently existing tag definitions.
Tags
val pp : Stdlib.Format.formatter -> t -> unitpp ppf tprints an unspecified representation oftonppf.
Tag sets
val empty : setemptyis the empty set.
val is_empty : set -> boolis_empty sistrueiffsis empty.
val add : 'a def -> 'a -> set -> setadd d v sisswith the tag(V (d, v))added. If there was a tag with definitiondinsit is replaced.
val get : 'a def -> set -> 'aget d sis likefind d sbut- raises Invalid_argument
if there is no tag with definition
dins.
val fold : (t -> 'a -> 'a) -> set -> 'a -> 'afold f s accis the result of foldingfover the tags ofsstarting withacc.
val pp_set : Stdlib.Format.formatter -> set -> unitpp_set ppf sprints an unspecified representation of s onppf.