[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[master] Only initialize logging via a method, not with every import (#584054).



Should also prevent the double import problem (but only with this module
of course).
---
 anaconda        |    1 +
 anaconda_log.py |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/anaconda b/anaconda
index bd99912..42c02b2 100755
--- a/anaconda
+++ b/anaconda
@@ -461,6 +461,7 @@ if __name__ == "__main__":
     # Set up logging as early as possible.
     import logging
     import anaconda_log
+    anaconda_log.init()
 
     log = logging.getLogger("anaconda")
     stdoutLog = logging.getLogger("anaconda.stdout")
diff --git a/anaconda_log.py b/anaconda_log.py
index b6f26f4..961cba1 100644
--- a/anaconda_log.py
+++ b/anaconda_log.py
@@ -164,4 +164,7 @@ class AnacondaLog:
             pid = int(pidfile.read())
             os.kill(pid, signal.SIGHUP)
 
-logger = AnacondaLog()
+logger = None
+def init():
+    global logger
+    logger = AnacondaLog()
-- 
1.6.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]