Remove misused Fatal*
This commit is contained in:
parent
fc19ab2868
commit
11297b38c5
8 changed files with 12 additions and 12 deletions
|
@ -56,7 +56,7 @@ func NewLogger(file string) *Logger {
|
||||||
if len(file) > 0 {
|
if len(file) > 0 {
|
||||||
fi, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
|
fi, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error opening file", err)
|
log.Error("Error opening file", err)
|
||||||
}
|
}
|
||||||
return &Logger{fi}
|
return &Logger{fi}
|
||||||
}
|
}
|
||||||
|
|
|
@ -322,7 +322,7 @@ func (provider *ConsulCatalog) Provide(configurationChan chan<- types.ConfigMess
|
||||||
}
|
}
|
||||||
err := backoff.RetryNotify(worker, backoff.NewExponentialBackOff(), notify)
|
err := backoff.RetryNotify(worker, backoff.NewExponentialBackOff(), notify)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Cannot connect to consul server %+v", err)
|
log.Errorf("Cannot connect to consul server %+v", err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ func (provider *Docker) Provide(configurationChan chan<- types.ConfigMessage, po
|
||||||
}
|
}
|
||||||
err := backoff.RetryNotify(operation, backoff.NewExponentialBackOff(), notify)
|
err := backoff.RetryNotify(operation, backoff.NewExponentialBackOff(), notify)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Cannot connect to docker server %+v", err)
|
log.Errorf("Cannot connect to docker server %+v", err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ func (provider *Kubernetes) Provide(configurationChan chan<- types.ConfigMessage
|
||||||
}
|
}
|
||||||
err := backoff.RetryNotify(operation, backOff, notify)
|
err := backoff.RetryNotify(operation, backOff, notify)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Cannot connect to Kubernetes server %+v", err)
|
log.Errorf("Cannot connect to Kubernetes server %+v", err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ func (provider *Marathon) Provide(configurationChan chan<- types.ConfigMessage,
|
||||||
}
|
}
|
||||||
err := backoff.RetryNotify(operation, backoff.NewExponentialBackOff(), notify)
|
err := backoff.RetryNotify(operation, backoff.NewExponentialBackOff(), notify)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Cannot connect to Marathon server %+v", err)
|
log.Errorf("Cannot connect to Marathon server %+v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ func (provider *Mesos) Provide(configurationChan chan<- types.ConfigMessage, poo
|
||||||
}
|
}
|
||||||
err := backoff.RetryNotify(operation, backoff.NewExponentialBackOff(), notify)
|
err := backoff.RetryNotify(operation, backoff.NewExponentialBackOff(), notify)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Cannot connect to mesos server %+v", err)
|
log.Errorf("Cannot connect to mesos server %+v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -393,9 +393,9 @@ func detectMasters(zk string, masters []string) <-chan []string {
|
||||||
if zk != "" {
|
if zk != "" {
|
||||||
log.Debugf("Starting master detector for ZK ", zk)
|
log.Debugf("Starting master detector for ZK ", zk)
|
||||||
if md, err := detector.New(zk); err != nil {
|
if md, err := detector.New(zk); err != nil {
|
||||||
log.Fatalf("failed to create master detector: %v", err)
|
log.Errorf("failed to create master detector: %v", err)
|
||||||
} else if err := md.Detect(detect.NewMasters(masters, changed)); err != nil {
|
} else if err := md.Detect(detect.NewMasters(masters, changed)); err != nil {
|
||||||
log.Fatalf("failed to initialize master detector: %v", err)
|
log.Errorf("failed to initialize master detector: %v", err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
changed <- masters
|
changed <- masters
|
||||||
|
|
|
@ -413,7 +413,7 @@ func (server *Server) prepareServer(entryPointName string, router *middlewares.H
|
||||||
negroni.UseHandler(router)
|
negroni.UseHandler(router)
|
||||||
tlsConfig, err := server.createTLSConfig(entryPointName, entryPoint.TLS, router)
|
tlsConfig, err := server.createTLSConfig(entryPointName, entryPoint.TLS, router)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Error creating TLS config %s", err)
|
log.Errorf("Error creating TLS config %s", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,7 +431,7 @@ func (server *Server) prepareServer(entryPointName string, router *middlewares.H
|
||||||
TLSConfig: tlsConfig,
|
TLSConfig: tlsConfig,
|
||||||
}, tlsConfig)
|
}, tlsConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Error hijacking server %s", err)
|
log.Errorf("Error hijacking server %s", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return gracefulServer, nil
|
return gracefulServer, nil
|
||||||
|
|
|
@ -203,7 +203,7 @@ func run(traefikConfiguration *TraefikConfiguration) {
|
||||||
// logging
|
// logging
|
||||||
level, err := log.ParseLevel(strings.ToLower(globalConfiguration.LogLevel))
|
level, err := log.ParseLevel(strings.ToLower(globalConfiguration.LogLevel))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error getting level", err)
|
log.Error("Error getting level", err)
|
||||||
}
|
}
|
||||||
log.SetLevel(level)
|
log.SetLevel(level)
|
||||||
if len(globalConfiguration.TraefikLogsFile) > 0 {
|
if len(globalConfiguration.TraefikLogsFile) > 0 {
|
||||||
|
@ -214,7 +214,7 @@ func run(traefikConfiguration *TraefikConfiguration) {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error opening file", err)
|
log.Error("Error opening file", err)
|
||||||
} else {
|
} else {
|
||||||
log.SetOutput(fi)
|
log.SetOutput(fi)
|
||||||
log.SetFormatter(&log.TextFormatter{DisableColors: true, FullTimestamp: true, DisableSorting: true})
|
log.SetFormatter(&log.TextFormatter{DisableColors: true, FullTimestamp: true, DisableSorting: true})
|
||||||
|
|
Loading…
Reference in a new issue