lib: Consistently set suture logging (#7202)

This commit is contained in:
Simon Frei
2020-12-18 19:44:00 +01:00
committed by GitHub
parent 7919310dc6
commit fa40ccece1
10 changed files with 21 additions and 26 deletions
+2 -5
View File
@@ -44,16 +44,13 @@ type cast struct {
// caller needs to set reader and writer with the addReader and addWriter
// methods to get a functional implementation of Interface.
func newCast(name string) *cast {
spec := util.Spec()
// Only log restarts in debug mode.
spec := util.SpecWithDebugLogger(l)
// Don't retry too frenetically: an error to open a socket or
// whatever is usually something that is either permanent or takes
// a while to get solved...
spec.FailureThreshold = 2
spec.FailureBackoff = 60 * time.Second
// Only log restarts in debug mode.
spec.EventHook = func(e suture.Event) {
l.Debugln(e)
}
c := &cast{
Supervisor: suture.New(name, spec),
name: name,