Change logger name to module itself instead of root

Using root logger will make public module log failed by unknow keyword.
Just change the logger name to module itself could dismiss this impact.
And disable logger.propagate could prevent double outputing.

Change-Id: I18696d124ebac9ca970d502558972e51de759097
Fixes: bug #1105133
This commit is contained in:
Kun Huang 2013-03-17 01:59:40 +08:00
parent b115356af6
commit 45dda5e356

View File

@ -158,7 +158,8 @@ if __name__ == '__main__':
sys.exit('Termination signal received.')
signal.signal(signal.SIGTERM, sigterm)
logger = logging.getLogger()
logger = logging.getLogger(__name__)
logger.propagate = False
logger.setLevel({
'debug': logging.DEBUG,
'info': logging.INFO,