- catbox caught this /var/log should be under destdir...

This commit is contained in:
Faik Uygur
2007-05-28 11:09:28 +00:00
parent c7939854c6
commit 2f3a23e13b
+6 -2
View File
@@ -70,8 +70,12 @@ def init(database = True, write = True,
else:
ctx.ui = ui
if os.access('/var/log', os.W_OK):
handler = logging.handlers.RotatingFileHandler('/var/log/pisi.log')
destdir = ""
if ctx.get_option('destdir'):
destdir = ctx.get_option('destdir')
if os.access('%s/var/log' % destdir, os.W_OK):
handler = logging.handlers.RotatingFileHandler('%s/var/log/pisi.log' % destdir)
#handler.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)-12s: %(levelname)-8s %(message)s')
handler.setFormatter(formatter)