D0 Error Logger from an L2 Perspective
Criteria
- no dynamic memory allocation
- must buffer errors in node and send them approx. every 5 secs to the
TCC
- must provide means to limit number of a given message type
- code needs to be simple and compact
- we can't include huge libraries
- very limited or no use of STL:
this may mean no streams or strings since it's not clear that these work
in the L2 alpha environment
- need at least some context information without continuous calls error
system to set it up (it would be nice to know a bit more than just the
node ID but we don't have time to call set methods throughout the code)
- errors must be capable of being sorted after they have left the L2
node. All our messages will be sent to a central workstation which must
then forward them to the alarm system or log files. While it's possible
to do this by parsing a string it's simpler to just keep the ID and severity
in machine-readable format and reduces CPU time on the node.
Possible Design
- use error objects which store severity, ID and text as well as methods to
produce a string (char * or class)
- have central dispatcher object
which has input objects and output
device objects
- dispatcher keeps count of messages by ID and attaches count to message
object before sending it on
- output devices attached via a filter
object which can reject messages over the limit or of too low a severity
- possibly different input objects for L2,online and offline - L2 can
be function call others can use stream interface if wanted
Possible Class Diagram