You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/10/25 14:43:56 UTC

[GitHub] [flink] fapaul commented on a change in pull request #17539: [FLINK-24612][connectors/kafka] Configure Kafka test container log le…

fapaul commented on a change in pull request #17539:
URL: https://github.com/apache/flink/pull/17539#discussion_r735674093



##########
File path: flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/sink/KafkaUtil.java
##########
@@ -43,6 +45,46 @@
 
     private KafkaUtil() {}
 
+    /**
+     * This method helps to set commonly used Kafka configurations and aligns the internal Kafka log
+     * levels with the ones used by the capturing logger.
+     *
+     * @param logger to derive the log level from
+     * @param container running Kafka
+     * @return configured Kafka container
+     */
+    public static KafkaContainer configureKafkaContainer(Logger logger, KafkaContainer container) {
+        String logLevel;
+        if (logger.isErrorEnabled()) {
+            logLevel = "ERROR";
+        } else if (logger.isTraceEnabled()) {
+            logLevel = "TRACE";
+        } else if (logger.isDebugEnabled()) {
+            logLevel = "DEBUG";
+        } else if (logger.isWarnEnabled()) {
+            logLevel = "WARN";
+        } else if (logger.isInfoEnabled()) {
+            logLevel = "INFO";
+        } else {
+            throw new IllegalStateException("Unsupported log level configured.");

Review comment:
       good catch I will default to `OFF`




-- 
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: issues-unsubscribe@flink.apache.org

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