From 285d05cfd2ac439c832f2859b8da15fde40d69a9 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Sun, 18 Oct 2015 03:46:52 +0300 Subject: [PATCH] Log messages on Kafka startup/shutdown --- example/kafka/kafka.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/example/kafka/kafka.go b/example/kafka/kafka.go index 1725d87..b2978bd 100644 --- a/example/kafka/kafka.go +++ b/example/kafka/kafka.go @@ -37,6 +37,9 @@ var ( // Initialize sets up the kafka package. func Initialize(brokers []string) { + log.Println("Initializing Kafka") + defer log.Println("Kafka is initialized") + conf := sarama.NewConfig() conf.ClientID = "Satan Example" @@ -53,6 +56,9 @@ func Initialize(brokers []string) { // Shutdown shuts down the kafka package. func Shutdown() { + log.Println("Shutting down Kafka") + defer log.Println("Kafka was shut down") + if err := kafkaConsumer.Close(); err != nil { panic(err) }