Could you help me solve the following incompatibility issue between Python 2.5 and 2.6?
logger.conf:
[loggers]
keys=root,aLogger,bLogger
[handlers]
keys=consoleHandler
[formatters]
keys=
[logger_root]
level=NOTSET
handlers=consoleHandler
[logger_aLogger]
level=DEBUG
handlers=consoleHandler
propagate=0
qualname=a
[logger_bLogger]
level=INFO
handlers=consoleHandler
propagate=0
qualname=b
[handler_consoleHandler]
class=StreamHandler
args=(sys.stderr,)
module_one.py:
import logging
import logging.config
logging.config.fileConfig('logger.conf')
a_log = logging.getLogger('a.submod')
b_log = logging.getLogger('b.submod')
def function_one():
b_log.info("function_one() called.")
module_two.py:
import logging
import logging.config
logging.config.fileConfig('logger.conf')
a_log = logging.getLogger('a.submod')
b_log = logging.getLogger('b.submod')
def function_two():
a_log.info("function_two() called.")
logger.py:
from module_one import function_one
from module_two import function_two
function_one()
function_two()
Output of calling logger.py under Ubuntu 9.04:
$ python2.5 logger.py
$
$ python2.6 logger.py
function_one() called.
function_two() called.
$