logging: getLogger() or getLogger(__name__)?

Malcolm Greene python at bdurham.com
Wed Jul 27 08:11:20 EDT 2016


I've read that best practice for logging is to place the following line
at the top of all modules:
 
logger = getLogger(__name__)
 
I'm curious why the following technique wouldn't be a better choice:
 
logger = getLogger()
 
Are there scenarios that favor one style over another?
 
Thank you,
Malcolm



More information about the Python-list mailing list