add logging on kafka reading

This commit is contained in:
Chris Lu
2018-09-19 22:31:45 -07:00
parent d9b32db8d7
commit d5149e592e
2 changed files with 7 additions and 0 deletions

View File

@@ -37,6 +37,12 @@ func (k *KafkaInput) initialize(hosts []string, topic string) (err error) {
config := sarama.NewConfig()
config.Consumer.Return.Errors = true
k.consumer, err = sarama.NewConsumer(hosts, config)
if err != nil {
panic(err)
} else {
glog.V(0).Infof("connected to %v", hosts)
}
k.topic = topic
k.messageChan = make(chan *sarama.ConsumerMessage, 1)