﻿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
27691	Avoid `logger=logging.getLogger(__name__)`	Thomas Güttler	nobody	"The current docs suggest this:


{{{
# import the logging library
import logging

# Get an instance of a logger
logger = logging.getLogger(__name__)

}}}


Source https://docs.djangoproject.com/en/dev/topics/logging/#using-logging

I don't like it. But I like the optimize-Imports feature of PyCharm, and the following line (often between the imports) disturbs this.

Is there no way to avoid this `logger = logging.getLogger(__name__)` ?

I asked this question some time ago at StackOverflow: http://stackoverflow.com/questions/34726515/avoid-logger-logging-getlogger-name

It would be very nice if this would be enough: `import logging .... logging.warn(...)`. But with the semantics of `logger = logging.getLogger(__name__)`.


"	Uncategorized	closed	Uncategorized	1.10	Normal	invalid			Unreviewed	0	0	0	0	0	0
