Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
feat: better logging when no connectors found
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Stevenson committed Sep 14, 2017
1 parent b28f7b7 commit 6186acd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ tasks.withType(Tar) {
}

task compile(dependsOn: 'compileScala')
task fatJar(dependsOn : ['test', 'shadowJar'])
task fatJar(dependsOn : ['clean', 'test', 'shadowJar'])

task fatJarNoTest(dependsOn : 'shadowJar')

Expand All @@ -121,7 +121,7 @@ tasks.withType(Jar) {
}
}

task buildCli(type: Exec, dependsOn: [shadowJar]) {
task buildCli(type: Exec, dependsOn: [fatJar]) {
commandLine "bin/package.sh", version
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class HumanFormatter extends Formatter {
* @return A formatted string
*/
override def connectorNames(connectorNames: Seq[String]): String = connectorNames.mkString("\n")

/**
* Formats a ConnectorInfo as a string
* @param connectorInfo the ConnectorInfo to format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,15 @@ class RestKafkaConnectApi(baseUrl: java.net.URI, httpClient: HttpClient = Scalaj
*/
def activeConnectorNames(): Try[Seq[String]] = {
import MyJsonProtocol._
Try(req[List[String]]("/connectors").get)
Try({
val names = req[List[String]]("/connectors").get
if (names.isEmpty) {
println(s"${Console.YELLOW}No running connectors${Console.RESET}")
names
} else {
names
}
})
}

/**
Expand Down

0 comments on commit 6186acd

Please sign in to comment.