hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDFS-7549) Add GenericTestUtils#disableLog, GenericTestUtils#setLogLevel
Date Thu, 18 Dec 2014 22:47:14 GMT
Colin Patrick McCabe created HDFS-7549:

             Summary: Add GenericTestUtils#disableLog, GenericTestUtils#setLogLevel
                 Key: HDFS-7549
                 URL: https://issues.apache.org/jira/browse/HDFS-7549
             Project: Hadoop HDFS
          Issue Type: Improvement
    Affects Versions: 2.7.0
            Reporter: Colin Patrick McCabe
            Assignee: Colin Patrick McCabe

Now that we are using both commons-logging and slf4j, we can no longer rely on just casting
the Log object to a {{Log4JLogger}} and calling {{setLevel}} on that.  With {{org.slf4j.Logger}}
objects, we need to look up the underlying {{Log4JLogger}} using {{LogManager#getLogger}}.

This patch adds {{GenericTestUtils#disableLog}} and {{GenericTestUtils#setLogLevel}} functions
which hide this complexity from unit tests, just allowing the tests to call {{disableLog}}
or {{setLogLevel}}, and have {{GenericTestUtils}} figure out the right thing to do based on
the log / logger type.

This message was sent by Atlassian JIRA

View raw message