Recommend a leading underscore on module-level loggers in docs
|Reported by:||dgolden_ichec||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The 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 is therefore common in pythonland i.e.
_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.