From eeb0859f994badeca23af7da0f7ea328ca0614f8 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 11 Aug 2020 17:24:12 +0530 Subject: [PATCH] util: rename FatalLog to FatalLogMsg for parity rename FatalLog to FatalLogMsg to keep functions in parity functions ends with Msg if its only message logging. Signed-off-by: Madhu Rajanna --- internal/util/httpserver.go | 2 +- internal/util/k8s.go | 6 +++--- internal/util/log.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/util/httpserver.go b/internal/util/httpserver.go index 6c1884741..cd2619635 100644 --- a/internal/util/httpserver.go +++ b/internal/util/httpserver.go @@ -21,6 +21,6 @@ func StartMetricsServer(c *Config) { http.Handle(c.MetricsPath, promhttp.Handler()) err := http.ListenAndServe(addr, nil) if err != nil { - FatalLog("failed to listen on address %v: %s", addr, err) + FatalLogMsg("failed to listen on address %v: %s", addr, err) } } diff --git a/internal/util/k8s.go b/internal/util/k8s.go index 831bb6bbd..e7129ed1c 100644 --- a/internal/util/k8s.go +++ b/internal/util/k8s.go @@ -32,17 +32,17 @@ func NewK8sClient() *k8s.Clientset { if cPath != "" { cfg, err = clientcmd.BuildConfigFromFlags("", cPath) if err != nil { - FatalLog("Failed to get cluster config with error: %v\n", err) + FatalLogMsg("Failed to get cluster config with error: %v\n", err) } } else { cfg, err = rest.InClusterConfig() if err != nil { - FatalLog("Failed to get cluster config with error: %v\n", err) + FatalLogMsg("Failed to get cluster config with error: %v\n", err) } } client, err := k8s.NewForConfig(cfg) if err != nil { - FatalLog("Failed to create client with error: %v\n", err) + FatalLogMsg("Failed to create client with error: %v\n", err) } return client } diff --git a/internal/util/log.go b/internal/util/log.go index 471955fc0..7447ad35a 100644 --- a/internal/util/log.go +++ b/internal/util/log.go @@ -53,7 +53,7 @@ func Log(ctx context.Context, format string) string { } // FatalLog helps in logging fatal errors. -func FatalLog(message string, args ...interface{}) { +func FatalLogMsg(message string, args ...interface{}) { logMessage := fmt.Sprintf(message, args...) klog.FatalDepth(1, logMessage) }