After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 375196 - dogtail log files not written to configured directory
dogtail log files not written to configured directory
Status: RESOLVED NOTABUG
Product: dogtail
Classification: Deprecated
Component: Framework
CVS HEAD
Other All
: Normal normal
: ---
Assigned To: Dogtail Maintainers
Dogtail Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-14 17:14 UTC by Bill Carter
Modified: 2007-02-14 22:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bill Carter 2006-11-14 17:14:36 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:
Comment 1 Zack Cerza 2006-11-17 18:09:06 UTC
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. :)
Comment 2 Bill Carter 2006-11-17 19:41:48 UTC
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 ...
Comment 3 Zack Cerza 2007-02-14 22:24:30 UTC
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.