summaryrefslogtreecommitdiffstats
path: root/yuminstall.py
diff options
context:
space:
mode:
authorRadek Vykydal <rvykydal@redhat.com>2009-06-16 16:48:05 +0200
committerRadek Vykydal <rvykydal@redhat.com>2009-06-18 16:13:39 +0200
commit96999a5ba329b41bf555ab945a4749755b97c974 (patch)
treeb1ed8b61662595f2af31924181016a42703565b7 /yuminstall.py
parente3d6d0fe9615b54956cb3a7b12a6d66d76059289 (diff)
downloadanaconda-96999a5ba329b41bf555ab945a4749755b97c974.tar.gz
anaconda-96999a5ba329b41bf555ab945a4749755b97c974.tar.xz
anaconda-96999a5ba329b41bf555ab945a4749755b97c974.zip
Log yum messages.
Overrides base class function: sets handlers for "yum" and "yum.verbose" - loggers that yum is using. Logs into tty3 and with more detail into yum.log.
Diffstat (limited to 'yuminstall.py')
-rw-r--r--yuminstall.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/yuminstall.py b/yuminstall.py
index 70635951a..6be1baae3 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -579,7 +579,33 @@ class AnacondaYum(YumSorter):
# Override this method so yum doesn't nuke our existing logging config.
def doLoggingSetup(self, *args, **kwargs):
- pass
+
+ import yum.logginglevels
+
+ file_handler = logging.FileHandler("/tmp/yum.log")
+ file_formatter = logging.Formatter("[%(asctime)s] %(levelname)-8s: %(message)s")
+ file_handler.setFormatter(file_formatter)
+
+ tty3_handler = logging.FileHandler("/dev/tty3")
+ tty3_formatter = logging.Formatter("%(asctime)s %(levelname)-8s: %(name)s: %(message)s", "%H:%M:%S")
+ tty3_handler.setFormatter(tty3_formatter)
+
+ verbose = logging.getLogger("yum.verbose")
+ verbose.setLevel(yum.logginglevels.DEBUG_2)
+ verbose.propagate = False
+ verbose.addHandler(file_handler)
+
+ logger = logging.getLogger("yum")
+ logger.propagate = False
+ logger.setLevel(yum.logginglevels.INFO_2)
+ logger.addHandler(file_handler)
+ logger.addHandler(tty3_handler)
+
+ # XXX filelogger is set in setFileLog - do we or user want it?
+ filelogger = logging.getLogger("yum.filelogging")
+ filelogger.setLevel(logging.INFO)
+ filelogger.propagate = False
+
def doConfigSetup(self, fn='/tmp/anaconda-yum.conf', root='/'):
if hasattr(self, "preconf"):