Add yum logging to yum.log
This commit is contained in:
parent
a4cf3c3c7c
commit
fd8684f1af
@ -26,6 +26,7 @@ import logging
|
|||||||
log = logging.getLogger("lorax")
|
log = logging.getLogger("lorax")
|
||||||
program_log = logging.getLogger("program")
|
program_log = logging.getLogger("program")
|
||||||
pylorax_log = logging.getLogger("pylorax")
|
pylorax_log = logging.getLogger("pylorax")
|
||||||
|
yum_log = logging.getLogger("yum")
|
||||||
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
@ -35,6 +36,9 @@ from optparse import OptionParser, OptionGroup
|
|||||||
import ConfigParser
|
import ConfigParser
|
||||||
|
|
||||||
import yum
|
import yum
|
||||||
|
# This is a bit of a hack to short circuit yum's internal logging
|
||||||
|
# handler setup. We already set one up so we don't need it to run.
|
||||||
|
yum.logginglevels._added_handlers = True
|
||||||
import pylorax
|
import pylorax
|
||||||
|
|
||||||
def setup_logging(opts):
|
def setup_logging(opts):
|
||||||
@ -63,6 +67,13 @@ def setup_logging(opts):
|
|||||||
fh.setLevel(logging.DEBUG)
|
fh.setLevel(logging.DEBUG)
|
||||||
program_log.addHandler(fh)
|
program_log.addHandler(fh)
|
||||||
|
|
||||||
|
# yum logging
|
||||||
|
yum_log.setLevel(logging.DEBUG)
|
||||||
|
logfile = os.path.abspath(os.path.dirname(opts.logfile))+"/yum.log"
|
||||||
|
fh = logging.FileHandler(filename=logfile, mode="w")
|
||||||
|
fh.setLevel(logging.DEBUG)
|
||||||
|
yum_log.addHandler(fh)
|
||||||
|
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
version = "{0} 0.1".format(os.path.basename(args[0]))
|
version = "{0} 0.1".format(os.path.basename(args[0]))
|
||||||
@ -260,6 +271,12 @@ def get_yum_base_object(installroot, repositories, mirrorlists=[],
|
|||||||
yb.preconf.root = installroot
|
yb.preconf.root = installroot
|
||||||
#yb.repos.setCacheDir(cachedir)
|
#yb.repos.setCacheDir(cachedir)
|
||||||
|
|
||||||
|
# Turn on as much yum logging as we can
|
||||||
|
yb.preconf.debuglevel = 6
|
||||||
|
yb.preconf.errorlevel = 6
|
||||||
|
yb.logger.setLevel(logging.DEBUG)
|
||||||
|
yb.verbose_logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
return yb
|
return yb
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user