1
0
Fork 0

Use statistics logger in example app

This commit is contained in:
Gregory Eremin 2015-10-24 02:42:00 +03:00
parent 0549519e0e
commit 78cfb92db3
1 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import (
"github.com/localhots/satan"
"github.com/localhots/satan/example/daemons"
"github.com/localhots/satan/example/kafka"
"github.com/localhots/satan/stats"
)
func main() {
@ -29,8 +30,13 @@ func main() {
kafka.Initialize(strings.Split(brokers, " "))
defer kafka.Shutdown()
logger := stats.NewStdoutLogger(0)
defer logger.Print()
s := satan.Summon()
s.SubscribeFunc = kafka.Subscribe
s.Statistics = logger
s.AddDaemon(&daemons.NumberPrinter{})
s.AddDaemon(&daemons.PriceConsumer{})