virajjasani commented on code in PR #5503:
URL: https://github.com/apache/hadoop/pull/5503#discussion_r1200771313


##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfiguration.java:
##########
@@ -220,27 +219,21 @@ public void testFinalWarnings() throws Exception {
     InputStream in2 = new ByteArrayInputStream(bytes2);
 
     // Attach our own log appender so we can verify output
-    TestAppender appender = new TestAppender();
-    final Logger logger = Logger.getRootLogger();
-    logger.addAppender(appender);
+    LogCapturer logCapturer = 
LogCapturer.captureLogs(LoggerFactory.getLogger("root"));

Review Comment:
   also, here is the impl of setLogLevel with this PR:
   
   ```
     static void setLogLevel(String loggerName, String levelName) {
       if (loggerName == null) {
         throw new IllegalArgumentException("logger name cannot be null");
       }
       Logger logger = loggerName.equalsIgnoreCase("root") ?
           LogManager.getRootLogger() :
           LogManager.getLogger(loggerName);
       Level level = Level.toLevel(levelName.toUpperCase());
       if (!level.toString().equalsIgnoreCase(levelName)) {
         throw new IllegalArgumentException("Unsupported log level " + 
levelName);
       }
       logger.setLevel(level);
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to