id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 14616 Recommend a leading underscore on module-level loggers in docs dgolden_ichec nobody "The [http://docs.djangoproject.com/en/dev/topics/logging/#naming-loggers in-development django logging docs], at least at time of writing, suggest using {{{""logger""}}} for module-level logger instances. That is problematic - consider people doing {{{""from blah import *""}}} and accidentally grabbing the ""wrong"" logger instance. Using a leading underscore on such module-level loggers [http://www.google.com/search?q=%22_log+%3D+logging.getLogger%28__name__%29%22 is therefore common in pythonland] i.e. {{{ #!python _log = logging.getLogger(__name__) }}} While this is ultimately just a python quirk, I suggest the docs should be trivially amended to recommend a leading underscore (e.g. {{{""_log""}}}) convention rather than {{{""logger""}}}, possibly with a very brief explanation as to why, for beginner-friendliness. Mistakenly importing another module's logger leads to quite confusing logging behaviour. " closed Documentation dev wontfix Unreviewed 0 0 0 0 0 0