class virtual ['level #event #archiver]
agent : 'level #prioritizer -> 'level -> ('level #event #archiver as 'a) list ->
object
.. end
The base class for journaling agents. Use inherit agent p v s
to
derive a subclass that defines the private event_
method to construct
an event object with a priority level and a message text using the
prioritizer p
. Sets the initial priority code minimum to v
, and
the initial list of archivers to s
.
val mutable archivers_ : 'a list
The current list of archivers that journal events from
this agent.
val mutable limit_ : Priority.t
The minimum priority code for a diagnostic event to be
constructed and passed to the archivers.
method private virtual event : 'level -> string -> ('level #event as 'b)
Define the private event
method to construct an event object
with a priority level and a message text.
method setlimit : 'level -> unit
Use a#setlimit v
to set the minimum priority code to the
code corresponding to the priority level v
.
method enabled : 'level -> bool
Use a#enabled v
to test whether the priority code
corresponding to the priority level v
is preceded in the
total order by the minimum priority code.
method private put : 'a0 'b0.
'level -> ('b -> 'b0) -> ('a0, unit, string, 'b0) Pervasives.format4 -> 'a0
Use this method in level-specific methods of the derived class
for constructing events and putting them to archivers. Use
super#put v c
to construct a function that takes a format
string (and arguments thereby specified) and, if self#enabled
v
returns true
then calls self#event v m
(where m
is
the message text given to the continuation provided to
Printf.kprintf
), iterates on archivers_
invoking the
emit
method for each one with the constructed event, and
finally passing the event to the continuation c
. The value
returned by c
is returned by the method when invoked with
a format string (and associated arguments).