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

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

 



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

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux