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

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



This looks reasonable. Ack.

--
Martin Sivák
msivak redhat com
Red Hat Czech
Anaconda team / Brno, CZ

----- "Ales Kozumplik" <akozumpl redhat com> wrote:

> 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 redhat com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list


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