package orsetto
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=151ca6df499bd3de7aa89a4e1627411fbee24c4dea6e0e71ce21f06f181ee654
md5=00393728b481c2bf15919a8202732335
doc/orsetto.cf/Cf_journal/Create/class-agent/index.html
Class Create.agent
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
.
constraint 'event = 'level event
constraint 'archiver = 'event archiver
The current list of archivers that journal events from this agent.
val mutable limit_ : P.t
The minimum priority code for a diagnostic event to be constructed and passed to the archivers.
Define the private event
method to construct an event object with a priority level and a message text.
Use a#setlimit v
to set the minimum priority code to the code corresponding to the priority level v
.
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 : 'a 'b. 'level ->
('event -> 'b) ->
('a, unit, string, string, string, 'b) format6 ->
'a
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).