fix logging in fuelmenu

If logging.basicConfig is called after logging.getLogger
then it will not work properly. So we have to call
basicConfig before imports.

Change-Id: I663aad3cc55925e09ebb3df916cd60cae196c350
Closes-Bug: #1596646
This commit is contained in:
Dmitry Guryanov 2016-06-27 21:23:12 +03:00
parent 31a06d5493
commit e7f0250488
1 changed files with 8 additions and 6 deletions

View File

@ -15,17 +15,23 @@
from __future__ import absolute_import
from fuelmenu import consts
import logging
# set up logging before other modules will try to get their loggers
logging.basicConfig(filename=consts.LOGFILE,
format="%(asctime)s %(levelname)s %(message)s",
level=logging.DEBUG)
from fuelmenu.common import dialog
from fuelmenu.common import network
from fuelmenu.common import timeout
from fuelmenu.common import urwidwrapper as widget
from fuelmenu.common import utils
from fuelmenu import consts
from fuelmenu import modules
from fuelmenu import settings as settings_module
import logging
from optparse import OptionParser
import os
import signal
@ -34,10 +40,6 @@ import urwid
import urwid.raw_display
import urwid.web_display
# set up logging
logging.basicConfig(filename=consts.LOGFILE,
format="%(asctime)s %(levelname)s %(message)s",
level=logging.DEBUG)
log = logging.getLogger('fuelmenu.loader')