mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
cleanup: move log functions to new internal/util/log package
Moving the log functions into its own internal/util/log package makes it possible to split out the humongous internal/util packages in further smaller pieces. This reduces the inter-dependencies between utility functions and components, preventing circular dependencies which are not allowed in Go. Updates: #852 Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
2036b587d7
commit
6d00b39886
@ -8,6 +8,8 @@ import (
|
||||
runtime_pprof "runtime/pprof"
|
||||
"strconv"
|
||||
|
||||
"github.com/ceph/ceph-csi/internal/util/log"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
@ -24,13 +26,13 @@ func StartMetricsServer(c *Config) {
|
||||
http.Handle(c.MetricsPath, promhttp.Handler())
|
||||
err := http.ListenAndServe(addr, nil)
|
||||
if err != nil {
|
||||
FatalLogMsg("failed to listen on address %v: %s", addr, err)
|
||||
log.FatalLogMsg("failed to listen on address %v: %s", addr, err)
|
||||
}
|
||||
}
|
||||
|
||||
func addPath(name string, handler http.Handler) {
|
||||
http.Handle(name, handler)
|
||||
DebugLogMsg("DEBUG: registered profiling handler on /debug/pprof/%s\n", name)
|
||||
log.DebugLogMsg("DEBUG: registered profiling handler on /debug/pprof/%s\n", name)
|
||||
}
|
||||
|
||||
// EnableProfiling enables golang profiling.
|
||||
|
Reference in New Issue
Block a user