Better starting message
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Tyler 2020-06-14 05:48:56 -04:00
parent 28b8df98b2
commit 4a6ab368c6

View File

@ -22,7 +22,7 @@ import (
"sync"
)
var VERSION = "1.4.1"
var VERSION = "1.4.4"
func packageName(name string) string {
if index := strings.Index(name, "_"); index != -1 {
@ -60,6 +60,11 @@ func main() {
os.Exit(0)
}
log.WithFields(log.Fields{
"version": VERSION,
"runtimeVersion": runtime.Version(),
}).Info("Starting deb-simple")
file, err := ioutil.ReadFile(*configFile)
if err != nil {
@ -148,11 +153,21 @@ func main() {
bind := fmt.Sprintf(":%d", conf.Http.Port)
if conf.Http.SSL {
log.Info("running with SSL enabled")
log.Fatalln(http.ListenAndServeTLS(bind, conf.Http.SSLCert, conf.Http.SSLKey, mux))
log.WithFields(log.Fields{
"bind": bind,
"certFile": conf.Http.SSLCert,
"keyFile": conf.Http.SSLKey,
}).Info("Starting with SSL enabled")
err = http.ListenAndServeTLS(bind, conf.Http.SSLCert, conf.Http.SSLKey, mux)
} else {
log.Info("running without SSL enabled")
log.Fatalln(http.ListenAndServe(bind, mux))
log.WithField("bind", bind).Info("Starting without SSL enabled")
err = http.ListenAndServe(bind, mux)
}
if err != nil {
log.WithError(err).Fatalln("Unable to start or keep running due to error")
}
}