Decrease log levels in router/registry package to not appear for CLI users (#1917)

This commit is contained in:
Janos Dobronszki 2020-08-10 14:57:45 +02:00 committed by GitHub
parent 65e6ee8566
commit 96836f2e43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -403,8 +403,8 @@ func (r *rtr) advertiseEvents() error {
// routing table watcher
w, err = r.Watch()
if err != nil {
if logger.V(logger.ErrorLevel, logger.DefaultLogger) {
logger.Errorf("Error creating watcher: %v", err)
if logger.V(logger.DebugLevel, logger.DefaultLogger) {
logger.Debugf("Error creating watcher: %v", err)
}
time.Sleep(time.Second)
continue
@ -412,8 +412,8 @@ func (r *rtr) advertiseEvents() error {
}
if err := r.watchTable(w); err != nil {
if logger.V(logger.ErrorLevel, logger.DefaultLogger) {
logger.Errorf("Error watching table: %v", err)
if logger.V(logger.DebugLevel, logger.DefaultLogger) {
logger.Debugf("Error watching table: %v", err)
}
time.Sleep(time.Second)
}
@ -563,7 +563,7 @@ func (r *rtr) start() error {
r.table.pruneRoutes(RefreshInterval)
case <-t1.C:
if err := r.loadRoutes(r.options.Registry); err != nil {
logger.Errorf("failed refreshing registry routes: %s", err)
logger.Debugf("failed refreshing registry routes: %s", err)
}
}
}
@ -640,8 +640,8 @@ func (r *rtr) Advertise() (<-chan *router.Advert, error) {
return
default:
if err := r.advertiseEvents(); err != nil {
if logger.V(logger.ErrorLevel, logger.DefaultLogger) {
logger.Errorf("Error adveritising events: %v", err)
if logger.V(logger.DebugLevel, logger.DefaultLogger) {
logger.Debugf("Error adveritising events: %v", err)
}
}
}