From 2f3a23e13b50ceca8f7f87cc49774e240f831952 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Mon, 28 May 2007 11:09:28 +0000 Subject: [PATCH] - catbox caught this /var/log should be under destdir... --- pisi/api.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pisi/api.py b/pisi/api.py index d52a2a06..ab2f2680 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -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)