Next: , Previous: Dumping procedures, Up: Procedures and variables


2.4.5 Event log procedures

THUD keeps an event log that you can also use. It is cleared whenever reset-internals is called.

— Procedure: log-event tag data

Add tag and data info to the event log. If tag is the symbol done, and DATA is eq? to the most recent entry's tag, the time difference in seconds is computed and logged. If over 60 seconds, minutes are also shown. If under 1 second, the output is in microseconds. (Note: Some operating systems may not support microsecond resolution, or may support it poorly.)

For example, here is some Scheme code from a hypothetical script that uses the event log to record and time a "characterization" operation:

          (log-event 'characterizing '(a b c))
          ... do stuff ...
          (log-event 'done 'characterizing)
          
          (display-event-log)
          =>
          19981018 Sun 16:07:24 -- internals reset
          19981018 Sun 16:07:37 -- characterizing (a b c)
          19981018 Sun 16:07:46 -- 8.971523 sec

In this case, the operation took almost nine seconds to complete.

— Procedure: log-event-verbosely tag data

Same as log-event, but also produce output.

— Procedure: display-event-log [msg]

Optionally display msg, then display the event log to the current output port.