David Malcolm wrote:
I didn't look at the PySTAF module, but having "submit"
be the only
method leaks lots of ugliness into the API.
It looks like a far more pythonic API could be written by having some
classes, with actual methods, such as:
Actually, there is such a class already - STAFLog [[
http://staf.sourceforge.net/current/STAFPython.htm#ToC_STAFLog ]] which
allows (only) writing to log at the moment.
Instead of:
result = submit('local', 'LOG', 'LOG GLOBAL LEVEL info LOGNAME py_temp
MESSAGE %s' % marshall(testObj))
example might contain:
from PySTAFLog import *
log_global_temp = STAFLog(handle, STAFLog.Global, "py_temp")
result = log_global_temp.log(STAFLog.Info, marshall(testObj))
There is also MONITOR service, which is simpler than LOG, though still
quite verbose:
$ STAF local MONITOR LOG MESSAGE "Test xyz started"
and STAFMonitor class
For querying logs handle.submit has to be used, though this is not a
problem, as most of the tests will use write-only access.
-- Marian