|
From: Kevin A. <al...@se...> - 2001-12-14 03:17:19
|
> From: Andy Todd [mailto:an...@ha...]
> >
> > I also changed the path returned by getLogFileName to always use the
> > application directory (sys.argv[0]) to avoid log files being
> created in many
> > different directories while the app is running.
>
>
> Err, could we make that a default which can be overrided? I would
> suggest that if the specified log file name is a simple file name
> 'xxx.yyy' you prepend the application directory, otherwise use whatever
> is supplied (be it an absolute or relative path). I try and avoid
> writing log files to my application directories.
How about this?
def getLogFileName( self ) :
# KEA 2001-12-13
# return the application path for the log file directory
# unless the user supplied filename contains a directory
path = os.path.split(self.getOption('logfile'))[0]
if path == '':
return os.path.abspath( \
os.path.join( \
os.path.dirname(sys.argv[0]), \
self.getOption('logfile')))
else:
return os.path.abspath(self.getOption('logfile'))
That's checked into cvs and appears to work. I tried these settings in my
pythoncard_user_config.py file:
'logfile':'c:\\temp\\pythoncard.log',
'logToStdout':0,
ka
|