package orsetto
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=9b654edb663ae697563f150824047052f3b1bf760398f24bce6350553f031f73c46b6337239a1acd871e61238597ea92046809e3358290ff14d6ba671b449085
doc/orsetto.cf/Cf_journal/Basic/class-agent/index.html
Class Basic.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.
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).