showuon commented on code in PR #17373:
URL: https://github.com/apache/kafka/pull/17373#discussion_r1812372018
##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/LoggersTest.java:
##########
@@ -166,25 +175,32 @@ public void testSetLevel() {
@Test
public void testSetRootLevel() {
- Logger root = logger("root");
- root.setLevel(Level.ERROR);
-
- Logger p = logger("a.b.c.p");
- Logger x = logger("a.b.c.p.X");
- Logger y = logger("a.b.c.p.Y");
- Logger z = logger("a.b.c.p.Z");
- Logger w = logger("a.b.c.s.W");
- x.setLevel(Level.INFO);
- y.setLevel(Level.INFO);
- z.setLevel(Level.INFO);
- w.setLevel(Level.INFO);
+ LoggerContext loggerContext = (LoggerContext)
LogManager.getContext(false);
+ Configuration config = loggerContext.getConfiguration();
+ LoggerConfig rootConfig = new LoggerConfig("", Level.ERROR, false);
+ config.addLogger("", rootConfig);
+ loggerContext.updateLoggers();
+
+ Logger root = LogManager.getLogger("");
Review Comment:
OK, could we add some comments for these changes?
--
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]