GNOME Bugzilla – Bug 375196
dogtail log files not written to configured directory
Last modified: 2007-02-14 22:24:30 UTC
Please describe the problem: In one of the Red Hat Magazine articles; http://www.redhat.com/magazine/021jul06/features/dogtail/ It says you can customize/configure the dogtail log directory at runtime using code similar to this; >>>import os >>>from dogtail.config import config >>>config.scratchDir = os.path.join(os.environ['HOME'], 'dogtail') >>>config.logDir = os.path.join(config.scratchDir, 'logs') >>>config.dataDir = os.path.join(config.scratchDir, 'data') However I find that when I attempt this the correct alternative directories are created, but the log data is still written to the default location; /tmp/dogtail/logs Steps to reproduce: 1. See summary. In my case I was attempting to have the logs placed in the current working directory. Actual results: Directories are created but no data written to them. Expected results: Does this happen every time? Yes. Other information:
It works for me... Can you tell me what version you're using? The report says CVS HEAD but I believe that's also the default. Just want to make sure. :)
I checked out the head of the CVS tree just now to make sure we have the most recent version. Looking in the NEWS file it says 0.6.1 It could be that I'm misunderstanding how this works, but here's what I'm doing. I have this script; ----------------------------- #!/usr/bin/python from dogtail.procedural import * import os from dogtail.config import config config.scratchDir = 'dogtail' config.logDir = os.path.join(config.scratchDir, 'logs') config.dataDir = os.path.join(config.scratchDir, 'data') run('gedit') focus.application('gedit') keyCombo("Escape") ------------------------------ When I run it I do get ./dogtail/logs directory but its empty. The default directory in /tmp does contain a logfile though. bash-3.1$ python test.py Creating logfile at /tmp/dogtail/logs/test_20061117-133342_debug ... Detecting distribution: Fedora (or derived distribution) GTK Accessibility Module initialized Creating /home/wscarter/progs/lsrtest/testscripts/dogtail ... Creating /home/wscarter/progs/lsrtest/testscripts/dogtail/logs ... Creating /home/wscarter/progs/lsrtest/testscripts/dogtail/data ...
dogtail.logging is what creates the logfiles, and only creates them once. If they're changed via dogtail.config *after* that dogtail.logging is loaded, that change won't properly be reflected. Whereas dogtail.procedural imports dogtail.logging, dogtail.config does not. So if you import dogtail.procedural after you set your config parameters, it should work. That generally goes for all config parameters. I'll close this bug now but please reopen if that doesn't fix your problem.