Only print console producer prompt with a tty
Reviewers: Chia-Ping Tsai
@@ -266,6 +266,7 @@ object ConsoleProducer {
var keySeparator = "\t"
var ignoreError = false
var lineNumber = 0
+ var printPrompt = System.console != null
override def init(inputStream: InputStream, props: Properties): Unit = {
topic = props.getProperty("topic")
@@ -280,6 +281,7 @@ object ConsoleProducer {
override def readMessage() = {
lineNumber += 1
+ if (printPrompt)
print(">")
(reader.readLine(), parseKey) match {
case (null, _) => null
