You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/09/09 14:47:28 UTC

[GitHub] [kafka] tombentley commented on a change in pull request #9266: KAFKA-10469: Resolve logger levels hierarchically

tombentley commented on a change in pull request #9266:
URL: https://github.com/apache/kafka/pull/9266#discussion_r485671503



##########
File path: core/src/test/scala/kafka/utils/LoggingTest.scala
##########
@@ -58,4 +60,20 @@ class LoggingTest extends Logging {
 
     assertEquals(logging.getClass.getName, logging.log.underlying.getName)
   }
+
+  @Test
+  def testLoggerLevelIsResolved(): Unit = {
+    val controller = new Log4jController()
+    val previousLevel = controller.getLogLevel("kafka")
+    try {
+      controller.setLogLevel("kafka", "TRACE")

Review comment:
       @dongjinleekr that would be fine for the `setLogLevel()` and `assertEquals` calls, but there would still be the level name in the `assertTrue(...contains("kafka=TRACE"))` calls. I think fixing it there would make the code harder to read, and given that the declaration of `TRACE` is in an external API on which we depend, and the name will not change there doesn't seem to be any benefit to using the declaration rather than the name as a literal.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org