views:

54

answers:

1

Should not it be handled by a single import? i.e. import logging. If I do not include import logging.config in my script, it gives :

AttributeError: 'module' object has no attribute 'config'

+4  A: 

logging is a package. Modules in packages aren't imported until you (or something in your program) imports them. You don't need both import logging and import logging.config though: just import logging.config will make the name logging available already.

Thomas Wouters