Skip to content

Commit

Permalink
Merge pull request #56 from shaior/remove_log
Browse files Browse the repository at this point in the history
replace log with glog
  • Loading branch information
mcornea authored Jan 29, 2024
2 parents 85eee7e + 1a2baec commit 594bb86
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
6 changes: 3 additions & 3 deletions tests/internal/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package cluster
import (
"errors"
"fmt"
"log"
"os"
"strings"

"github.com/golang/glog"
"github.com/openshift-kni/eco-goinfra/pkg/clients"
"github.com/openshift-kni/eco-goinfra/pkg/clusterversion"

Expand Down Expand Up @@ -56,7 +56,7 @@ func GetClusterName(kubeconfigEnvVar string) (string, error) {

clusterName := splits[1]

log.Println("cluster name: ", clusterName)
glog.V(100).Infof("cluster name: ", clusterName)

return clusterName, nil
}
Expand Down Expand Up @@ -84,7 +84,7 @@ func GetClusterVersion(apiClient *clients.Settings) (string, error) {
}
}

log.Println("Warning: No completed version found in clusterversion. Returning desired version")
glog.V(100).Infof("Warning: No completed version found in clusterversion. Returning desired version")

return clusterVersion.Object.Status.Desired.Version, nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"log"
"math"
"os"
"regexp"
Expand Down Expand Up @@ -342,7 +341,7 @@ func CollectPowerUsageMetrics(duration, samplingInterval time.Duration, scenario
return nil, err
}

log.Printf("Power usage test started: %v\nPower usage test ended: %v\n", startTime, time.Now())
glog.V(100).Infof("Power usage test started: %v\nPower usage test ended: %v\n", startTime, time.Now())

if len(powerMeasurements) < 1 {
return nil, errors.New("no power usage metrics were retrieved")
Expand All @@ -356,7 +355,7 @@ func CollectPowerUsageMetrics(duration, samplingInterval time.Duration, scenario
func GetHostPowerUsage(nodeName string) (map[string]float64, error) {
user, password, hosts := ParseBmcInfo(inittools.GeneralConfig)
if len(hosts) > 1 {
log.Printf("multiple hosts detected, only using %s\n", hosts[0])
glog.V(100).Infof("multiple hosts detected, only using %s\n", hosts[0])
}

subcommands := []string{"dcmi", "power", "reading"}
Expand Down Expand Up @@ -524,7 +523,7 @@ func CollectPowerMetricsWithSteadyWorkload(duration, samplingInterval time.Durat
return nil, errors.New("not enough stress-ng pods to run test")
}

log.Printf("Wait for %s for %s scenario\n", duration.String(), scenario)
glog.V(100).Infof("Wait for %s for %s scenario\n", duration.String(), scenario)
result, err := CollectPowerUsageMetrics(duration, samplingInterval, scenario, tag, snoNode.Name)
// Delete stress-ng pods.

Expand All @@ -545,7 +544,7 @@ func DeployStressNgPods(stressNgCPUCount, stressngMaxPodCount int, node *corev1.

var err error
// Create and wait for stress-ng pods to be Ready
log.Printf("Creating up to %d stress-ng pods with total %d cpus", stressngMaxPodCount, stressNgCPUCount)
glog.V(100).Infof("Creating up to %d stress-ng pods with total %d cpus", stressngMaxPodCount, stressNgCPUCount)

stressngPods := []*pod.Builder{}

Expand All @@ -558,7 +557,7 @@ func DeployStressNgPods(stressNgCPUCount, stressngMaxPodCount int, node *corev1.
}

WaitForPodsHealthy(stressngPods, 20*time.Minute)
log.Printf("%d stress-ng pods with total %d cpus are created and running", len(stressngPods), stressNgCPUCount)
glog.V(100).Infof("%d stress-ng pods with total %d cpus are created and running", len(stressngPods), stressNgCPUCount)

return stressngPods
}
Expand Down
3 changes: 0 additions & 3 deletions tests/ranfunc/talm/internal/talmhelper/talmhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,6 @@ func FilterMissingResourceErrors(err error) error {
return nil
}

// Reduce logging until we can have different log levels in future project
// log.Printf("Checking error '%s'", err.Error())

if strings.Contains(err.Error(), "server could not find the requested resource") {
return nil
}
Expand Down

0 comments on commit 594bb86

Please sign in to comment.