Skip to content

Commit 5d14103

Browse files
committed
simplify configLog
1 parent 6678e65 commit 5d14103

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

kyuubi-common/src/main/scala/org/apache/kyuubi/service/authentication/JdbcAuthenticationProviderImpl.scala

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,16 @@ class JdbcAuthenticationProviderImpl(conf: KyuubiConf) extends PasswdAuthenticat
9898
}
9999

100100
private def checkJdbcConfigs(): Unit = {
101-
def configLog(config: String, value: String): String = s"JDBCAuthConfig: $config = '$value'"
101+
val configLog = {
102+
case (config: String, value: Option[String]) => s"JDBCAuthConfig: $config = '${value.orNull}'"
103+
case (config: String, value: String) => s"JDBCAuthConfig: $config = '$value'"
104+
}
102105

103-
debug(configLog("Driver Class", driverClass.orNull))
104-
debug(configLog("JDBC URL", authDbJdbcUrl.orNull))
105-
debug(configLog("Database user", authDbUser.orNull))
106+
debug(configLog("Driver Class", driverClass))
107+
debug(configLog("JDBC URL", authDbJdbcUrl))
108+
debug(configLog("Database user", authDbUser))
106109
debug(configLog("Database password", JdbcUtils.redactPassword(authDbPassword)))
107-
debug(configLog("Query SQL", authQuery.orNull))
110+
debug(configLog("Query SQL", authQuery))
108111

109112
// Check if JDBC parameters valid
110113
require(driverClass.nonEmpty, "JDBC driver class is not configured.")

0 commit comments

Comments
 (0)