Sfoglia il codice sorgente

only error log when err is not nil

bergquist 7 anni fa
parent
commit
65352dccc0
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      pkg/cmd/grafana-server/server.go

+ 1 - 1
pkg/cmd/grafana-server/server.go

@@ -138,7 +138,7 @@ func (g *GrafanaServerImpl) Run() error {
 			err := service.Run(g.context)
 
 			// If error is not canceled then the service crashed
-			if err != context.Canceled {
+			if err != context.Canceled && err != nil {
 				g.log.Error("Stopped "+reflect.TypeOf(service).Elem().Name(), "reason", err)
 			} else {
 				g.log.Info("Stopped "+reflect.TypeOf(service).Elem().Name(), "reason", err)