change logging level

This commit is contained in:
wh1te909 2022-11-28 23:19:58 -08:00
parent 7358907b3c
commit 36e9065474

View File

@ -408,16 +408,16 @@ func (a *Agent) setupNatsOptions() []nats.Option {
opts = append(opts, nats.ReconnectBufSize(-1))
opts = append(opts, nats.ProxyPath(a.NatsProxyPath))
opts = append(opts, nats.DisconnectErrHandler(func(nc *nats.Conn, err error) {
a.Logger.Debugln("NATS disconnected:", err)
a.Logger.Debugf("%+v\n", nc.Statistics)
a.Logger.Errorln("NATS disconnected:", err)
a.Logger.Errorf("%+v\n", nc.Statistics)
}))
opts = append(opts, nats.ReconnectHandler(func(nc *nats.Conn) {
a.Logger.Debugln("NATS reconnected")
a.Logger.Debugf("%+v\n", nc.Statistics)
a.Logger.Infoln("NATS reconnected")
a.Logger.Infof("%+v\n", nc.Statistics)
}))
opts = append(opts, nats.ErrorHandler(func(nc *nats.Conn, sub *nats.Subscription, err error) {
a.Logger.Debugln("NATS error:", err)
a.Logger.Debugf("%+v\n", sub)
a.Logger.Errorln("NATS error:", err)
a.Logger.Errorf("%+v\n", sub)
}))
return opts
}