Module Logs.Src
Sources.
Sources
type t
= src
The type for log sources.
val create : ?doc:string -> string -> src
create ?doc name
is a new log source.name
is the name of the source; it doesn't need to be unique but it is good practice to prefix the name with the name of your package or library (e.g."mypkg.network"
).doc
is a documentation string describing the source, defaults to"undocumented"
. The initial reporting level of the source is defined byLogs.level
.
val name : src -> string
name
issrc
's name.
val doc : src -> string
doc src
issrc
's documentation string.
val set_level : src -> level option -> unit
set_level src l
sets the report level ofsrc
tol
. Only applications should use this function directly, see usage conventions.
val pp : Stdlib.Format.formatter -> src -> unit
pp ppf src
prints an unspecified representation ofsrc
onppf
.
val list : unit -> src list
list ()
is the current exisiting source list.