prysm-pulse/sharding/utils/service.go
Raul Jordan f5e5287082 sharding: Remove Dependency on Geth: Replace Log With Logrus Package (#242)
Former-commit-id: 2ec35880b3aa30d3c217815c9a474e8d81ee1fa8 [formerly c20da02cf9149990f8b7913cfe426b8036992c16]
Former-commit-id: 4851374829557f1523f5994b1d97e08e46979aed
2018-07-09 21:27:23 -05:00

20 lines
444 B
Go

package utils
import (
log "github.com/sirupsen/logrus"
)
// HandleServiceErrors manages a goroutine that listens for errors broadcast to
// this service's error channel. This serves as a final step for error logging
// and is stopped upon the service shutting down.
func HandleServiceErrors(done <-chan struct{}, errChan <-chan error) {
for {
select {
case <-done:
return
case err := <-errChan:
log.Error(err.Error())
}
}
}