[PATCH 2/2] Do yum lock logging only with inst.debug or loglevel=debug
Vratislav Podzimek
vpodzime at redhat.com
Mon Nov 18 13:44:45 UTC 2013
Otherwise pre-release logs are quite big due to the yum lock logging and
exception handling takes a lot of time before the exception dialog appears.
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
anaconda | 6 ++++++
pyanaconda/anaconda_log.py | 3 ++-
pyanaconda/packaging/yumpayload.py | 6 +++---
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/anaconda b/anaconda
index ca0c17e..fcaeb1c 100755
--- a/anaconda
+++ b/anaconda
@@ -342,10 +342,16 @@ def setupEnvironment():
del os.environ["LD_PRELOAD"]
def setupLoggingFromOpts(options):
+ if options.debug:
+ # debugging means debug logging
+ options.loglevel = "debug"
+
if options.loglevel and anaconda_log.logLevelMap.has_key(options.loglevel):
level = anaconda_log.logLevelMap[opts.loglevel]
anaconda_log.logger.tty_loglevel = level
anaconda_log.setHandlersLevel(log, level)
+ packaging_log = logging.getLogger("packaging")
+ anaconda_log.setHandlersLevel(packaging_log, level)
storage_log = logging.getLogger("storage")
anaconda_log.setHandlersLevel(storage_log, level)
diff --git a/pyanaconda/anaconda_log.py b/pyanaconda/anaconda_log.py
index c71181f..3e90c51 100644
--- a/pyanaconda/anaconda_log.py
+++ b/pyanaconda/anaconda_log.py
@@ -125,7 +125,8 @@ class AnacondaLog:
packaging_logger = logging.getLogger("packaging")
packaging_logger.setLevel(logging.DEBUG)
self.addFileHandler(PACKAGING_LOG_FILE, packaging_logger,
- minLevel=logging.DEBUG)
+ minLevel=logging.INFO,
+ autoLevel=True)
self.forwardToSyslog(packaging_logger)
# Create the yum logger and link it to packaging
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 2f2813a..c82fc94 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -103,16 +103,16 @@ class YumLock(object):
frame = inspect.stack()[2]
threadName = threading.currentThread().name
- log.info("about to acquire _yum_lock for %s at %s:%s (%s)", threadName, frame[1], frame[2], frame[3])
+ log.debug("about to acquire _yum_lock for %s at %s:%s (%s)", threadName, frame[1], frame[2], frame[3])
_private_yum_lock.acquire()
- log.info("have _yum_lock for %s", threadName)
+ log.debug("have _yum_lock for %s", threadName)
return _private_yum_lock
def __exit__(self, exc_type, exc_val, exc_tb):
_private_yum_lock.release()
if not isFinal:
- log.info("gave up _yum_lock for %s", threading.currentThread().name)
+ log.debug("gave up _yum_lock for %s", threading.currentThread().name)
def invalidates_br_cache(cond_fn=None):
"""
--
1.8.4.2
More information about the anaconda-patches
mailing list