GNOME Bugzilla – Bug 360927
Use python logging mode
Last modified: 2006-12-08 05:19:24 UTC
Use python logging mode instead of default LDTP logging module.
Peter Parente comment in bug # 345734 The configurability of the standard logging module is desirable for testing Linux Screen Reader. What we need is a way to interleave output from the screen reader and dogtail into a single log file, like so: [dogtail INFO] starting test id #gedit-001 [lsr INFO] File <group> [lsr INFO] menu item <role> [lsr INFO] New <item> [lsr INFO] Ctrl-N <hotkey> [dogtail INFO] ending test We do this today by: 1) defining an XML-RPC handler for the logging system 2) running an XML-RPC server that simply dumps messages to a file 3) configuring the logging system in both LSR and dogtail using a logging config file 4) manually adding logging statements to dogtail scripts It would be better if dogtail supported the standard logging module for all of its logging such that the test harness could configure it externally. For instance, test LSR, we could use an external xmlrpc.conf file to tell the test system to use our XML-RPC handler, what channels to log, what levels to log at, etc. With all log calls in dogtail supporting this configuration, we won't have to manually add references to our logger in dogtail scripts. This doesn't mean that you have to sacrifice simplicity for configurability. The default configuration for the logging module could be whatever you currently have. Plus, you can simply bind the log object info method (debug, warn, whatever) to the name of the function you currently have for logging (log(msg) ?). Here's the code we use in LSR, for your reference. xmlrpc config file http://cvs.gnome.org/viewcvs/lsr/test/xmlrpc-log.conf?rev=1.2&view=markup xmlrpc server http://cvs.gnome.org/viewcvs/lsr/test/logserver.py?rev=1.1&view=markup xmlrpc client code http://cvs.gnome.org/viewcvs/lsr/src/LSRLog.py?rev=1.2&view=markup /s/dogtail/LDTP/ ;)
Available as part of LDTP 0.7.0 release.