Refactor output logic for reuse

Move the logic for printing stuff based on the events
out of the monitor command so it can be reused in the
report command.

Change "locals" to "local_vars" to be consistent and
avoid clashing with the builtin locals().

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Define EventProcessor base class

Define a base class that specifies the API for
classes that are involved in the event processing.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Pass line source to output formatter

Instead of assuming that we can use the linecache
module to get source lines for files, pass an arg
to the formatter.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Misc refactoring of output formatting code

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
make sure exception arguments are sent

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
exceptions reported as warnings

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Add list command

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Add replay command and update list command

Make list show the timestamps in ISO format.

Change database recording of run to jsonify the description,
which is usually a list of command line args.

Add DB methods for querying data written to the database.

Add replay method for retrieving a given run and printing
it in the same format as the monitor command.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
fix argument name in tracer

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
add --errors option to list command

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Clean up db code

Move a few functions around to keep the inserts near
the selects.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
add file caching to db api

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Cache source files in the database

As the events come in, cache the source files in
the database so when we go to review the file later
we have the version of the source from the time
of execution.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>
Have replay get source lines from database

Have the replay command load the source lines
from the database, in case they have changed
between runs.

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>