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 def
- The 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. See- def.
- val def : ?doc:string -> string -> (Stdlib.Format.formatter -> 'a -> unit) -> 'a def
- def ~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 -> string
- name dis- d's name.
- val doc : 'a def -> string
- doc dis- d's documentation string.
- val printer : 'a def -> Stdlib.Format.formatter -> 'a -> unit
- printer dis- d's type pretty-printer.
- val pp_def : Stdlib.Format.formatter -> 'a def -> unit
- pp_def ppf dprints an unspecified representation of- don- ppf.
- val list : unit -> def_e list
- tag_list ()is the list of currently existing tag definitions.
Tags
- val pp : Stdlib.Format.formatter -> t -> unit
- pp ppf tprints an unspecified representation of- ton- ppf.
Tag sets
- val empty : set
- emptyis the empty set.
- val is_empty : set -> bool
- is_empty sis- trueiff- sis empty.
- val add : 'a def -> 'a -> set -> set
- add d v sis- swith the tag- (V (d, v))added. If there was a tag with definition- din- sit is replaced.
- val get : 'a def -> set -> 'a
- get d sis like- find d sbut- raises Invalid_argument
- if there is no tag with definition - din- s.
 
- val fold : (t -> 'a -> 'a) -> set -> 'a -> 'a
- fold f s accis the result of folding- fover the tags of- sstarting with- acc.
- val pp_set : Stdlib.Format.formatter -> set -> unit
- pp_set ppf sprints an unspecified representation of s on- ppf.