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

Add GenericTestUtils#disableLog, GenericTestUtils#setLogLevel

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.7.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: