internal: cleanup logging, remove duplicate code

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-12-22 10:33:21 +01:00
parent 22a8603892
commit b3ba083ff0
8 changed files with 26 additions and 54 deletions

View File

@ -52,9 +52,10 @@ func RunMetricsServer() {
return
}
})
l.WithField("listen", config.G.Web.ListenMetrics).Info("Listening (metrics)")
l.WithField("listen", config.G.Web.ListenMetrics).Info("Starting Metrics server")
err := http.ListenAndServe(config.G.Web.ListenMetrics, m)
if err != nil {
panic(err)
l.WithError(err).Warning("Failed to start metrics server")
}
l.WithField("listen", config.G.Web.ListenMetrics).Info("Stopping Metrics server")
}