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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]