mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-12 17:30:19 +00:00
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 <madhupr007@gmail.com>
This commit is contained in:
parent
71a6dc3ba8
commit
eeb0859f99
@ -21,6 +21,6 @@ func StartMetricsServer(c *Config) {
|
|||||||
http.Handle(c.MetricsPath, promhttp.Handler())
|
http.Handle(c.MetricsPath, promhttp.Handler())
|
||||||
err := http.ListenAndServe(addr, nil)
|
err := http.ListenAndServe(addr, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
FatalLog("failed to listen on address %v: %s", addr, err)
|
FatalLogMsg("failed to listen on address %v: %s", addr, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,17 +32,17 @@ func NewK8sClient() *k8s.Clientset {
|
|||||||
if cPath != "" {
|
if cPath != "" {
|
||||||
cfg, err = clientcmd.BuildConfigFromFlags("", cPath)
|
cfg, err = clientcmd.BuildConfigFromFlags("", cPath)
|
||||||
if err != nil {
|
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 {
|
} else {
|
||||||
cfg, err = rest.InClusterConfig()
|
cfg, err = rest.InClusterConfig()
|
||||||
if err != nil {
|
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)
|
client, err := k8s.NewForConfig(cfg)
|
||||||
if err != nil {
|
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
|
return client
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ func Log(ctx context.Context, format string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FatalLog helps in logging fatal errors.
|
// FatalLog helps in logging fatal errors.
|
||||||
func FatalLog(message string, args ...interface{}) {
|
func FatalLogMsg(message string, args ...interface{}) {
|
||||||
logMessage := fmt.Sprintf(message, args...)
|
logMessage := fmt.Sprintf(message, args...)
|
||||||
klog.FatalDepth(1, logMessage)
|
klog.FatalDepth(1, logMessage)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user