#27691: Avoid `logger=logging.getLogger(__name__)`
------------------------------------------+------------------------
               Reporter:  Thomas Güttler  |          Owner:  nobody
                   Type:  Uncategorized   |         Status:  new
              Component:  Uncategorized   |        Version:  1.10
               Severity:  Normal          |       Keywords:
           Triage Stage:  Unreviewed      |      Has patch:  0
    Needs documentation:  0               |    Needs tests:  0
Patch needs improvement:  0               |  Easy pickings:  0
                  UI/UX:  0               |
------------------------------------------+------------------------
 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__)`.

--
Ticket URL: <https://code.djangoproject.com/ticket/27691>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.8eb63e39c6f287635611a50f59e3c111%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to