Преглед изворни кода

reverse argument order for clarity in templating

AjayTripathy пре 5 година
родитељ
комит
aceadf049d
2 измењених фајлова са 4 додато и 4 уклоњено
  1. 1 1
      pkg/costmodel/costmodel.go
  2. 3 3
      pkg/log/log.go

+ 1 - 1
pkg/costmodel/costmodel.go

@@ -1140,7 +1140,7 @@ func (cm *CostModel) GetNodeCost(cp costAnalyzerCloud.Provider) (map[string]*cos
 
 		cnode, err := cp.NodePricing(cp.GetKey(nodeLabels, n))
 		if err != nil {
-			log.DedupedWarningf("Error getting node pricing. Error: %s", 10, err.Error())
+			log.DedupedWarningf(10, "Error getting node pricing. Error: %s", err.Error())
 			if cnode != nil {
 				nodes[name] = cnode
 				continue

+ 3 - 3
pkg/log/log.go

@@ -13,7 +13,7 @@ func Errorf(format string, a ...interface{}) {
 	klog.Errorf(fmt.Sprintf("[Error] %s", format), a...)
 }
 
-func DedupedErrorf(format string, logTypeLimit int, a ...interface{}) {
+func DedupedErrorf(logTypeLimit int, format string, a ...interface{}) {
 	timesLogged, ok := seen[format]
 	if !ok {
 		seen[format] = 1
@@ -33,7 +33,7 @@ func Warningf(format string, a ...interface{}) {
 	klog.V(2).Infof(fmt.Sprintf("[Warning] %s", format), a...)
 }
 
-func DedupedWarningf(format string, logTypeLimit int, a ...interface{}) {
+func DedupedWarningf(logTypeLimit int, format string, a ...interface{}) {
 	timesLogged, ok := seen[format]
 	if !ok {
 		seen[format] = 1
@@ -53,7 +53,7 @@ func Infof(format string, a ...interface{}) {
 	klog.V(3).Infof(fmt.Sprintf("[Info] %s", format), a...)
 }
 
-func DedupedInfof(format string, logTypeLimit int, a ...interface{}) {
+func DedupedInfof(logTypeLimit int, format string, a ...interface{}) {
 	timesLogged, ok := seen[format]
 	if !ok {
 		seen[format] = 1