[ 
https://issues.apache.org/jira/browse/AVRO-1874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15362210#comment-15362210
 ] 

ASF GitHub Bot commented on AVRO-1874:
--------------------------------------

GitHub user torgebo opened a pull request:

    https://github.com/apache/avro/pull/105

    AVRO-1874 Correct module level logging importation.

    Use logging as logger in handler simply and without configuration
    unsets logging level set by host application.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/torgebo/avro fix-py3_logging_level

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/avro/pull/105.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #105
    
----
commit 3c21ed32fe50c7b86d626990b8656eb7d7e8d558
Author: Torgeir Boerresen <[email protected]>
Date:   2016-07-05T08:28:23Z

    AVRO-1874 Correct module level logging importation.
    
    Use logging as logger handler simply and without configuration
    unsets logging level set by host application.

----


> py3 avro module import upsets logging level in host application
> ---------------------------------------------------------------
>
>                 Key: AVRO-1874
>                 URL: https://issues.apache.org/jira/browse/AVRO-1874
>             Project: Avro
>          Issue Type: Bug
>          Components: python
>    Affects Versions: 1.8.1
>         Environment: Mac OSX El Capitan, Macbook Pro,
> Anaconda Python v. 3.5.1
> Avro installed from source of Avro1.8.1/lang/py3
> (apache package "avro-src-1.8.1.tar.gz")
> using "sudo python setup.py install"
>            Reporter: Torgeir Børresen
>            Priority: Minor
>
> When importing "avro.datafile" the logging level of the host application gets 
> overriden.
> In the simple example provided here: 
> https://github.com/torgebo/avro-1.8.1-logging-break
> the logging level is wrongfully set to "logging.WARNING" during execution 
> instead of "logging.INFO".
> The issue seems to be resolved by using module level loggers in the pattern of
> logger = logging.getLogger(__name__)
> and replacing current calls to the logger named "logging" as this logger 
> "logger" instead. This approach is described here: 
> https://docs.python.org/3/howto/logging.html#logging-advanced-tutorial
> When setting logger across all avro source files, it is observed that the 
> application sets the logging level faithfully.
> ----
> This issue was not observed with python version 2, although the recommended 
> way to resolve module level logging as described in the logging python docs 
> seems to be the same (ie. using the logging.getLogger method to access the 
> logger handle).
> ----



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to