Avoid `logger=logging.getLogger(__name__)` without loosing : I am lazy and want to avoid this line in every python file which uses logging:


    logger = logging.getLogger(__name__)

In january I asked how this could be done, and found an answer: http://stackoverflow.com/questions/34726515/avoid-logger-logging-getlogger-name

Unfortunately the answer there has the drawback, that you loose the ability to filter.

I really want to avoid this useless and redundant line.

Example:

    import logging
    
    def my_method(foo):
        logging.info() 

Unfortunately I think it is impossible do `logger = logging.getLogger(__name__)` implicitly if `logging.info()` gets called for the first time in this file.

Is there anybody out there who knows how to do impossible stuff?

