Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-11430

Add GenericTestUtils#disableLog, GenericTestUtils#setLogLevel

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.0
    • 2.7.0
    • None
    • None

    Description

      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.

      Attachments

        1. HADOOP-11430.001.patch
          8 kB
          Colin McCabe

        Issue Links

          Activity

            People

              cmccabe Colin McCabe
              cmccabe Colin McCabe
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: