From c09f10ef926887686a138dad44a4bc28bedbb88b Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Mon, 28 May 2007 11:11:06 +0000 Subject: [PATCH] - forward port, var/log under destdir --- pisi/api.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pisi/api.py b/pisi/api.py index f52e4285..218bab2b 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -73,8 +73,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)