From c3b227a4f2916b1229f12ef20eb576a509aad444 Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Tue, 17 Apr 2018 20:31:14 +0200 Subject: [PATCH] Switch to common/log --- collector/hyperv.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/collector/hyperv.go b/collector/hyperv.go index 38aca410..f203eadc 100644 --- a/collector/hyperv.go +++ b/collector/hyperv.go @@ -1,11 +1,11 @@ package collector import ( - "log" "strings" "github.com/StackExchange/wmi" "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/common/log" ) func init() { @@ -470,37 +470,37 @@ func NewHyperVCollector() (Collector, error) { // to the provided prometheus Metric channel. func (c *HyperVCollector) Collect(ch chan<- prometheus.Metric) error { if desc, err := c.collectVmHealth(ch); err != nil { - log.Println("[ERROR] failed collecting hyperV health status metrics:", desc, err) + log.Error("failed collecting hyperV health status metrics:", desc, err) return err } if desc, err := c.collectVmVid(ch); err != nil { - log.Println("[ERROR] failed collecting hyperV pages metrics:", desc, err) + log.Error("failed collecting hyperV pages metrics:", desc, err) return err } if desc, err := c.collectVmHv(ch); err != nil { - log.Println("[ERROR] failed collecting hyperV hv status metrics:", desc, err) + log.Error("failed collecting hyperV hv status metrics:", desc, err) return err } if desc, err := c.collectVmProcessor(ch); err != nil { - log.Println("[ERROR] failed collecting hyperV processor metrics:", desc, err) + log.Error("failed collecting hyperV processor metrics:", desc, err) return err } if desc, err := c.collectVmRate(ch); err != nil { - log.Println("[ERROR] failed collecting hyperV rate metrics:", desc, err) + log.Error("failed collecting hyperV rate metrics:", desc, err) return err } if desc, err := c.collectVmSwitch(ch); err != nil { - log.Println("[ERROR] failed collecting hyperV switch metrics:", desc, err) + log.Error("failed collecting hyperV switch metrics:", desc, err) return err } if desc, err := c.collectVmEthernet(ch); err != nil { - log.Println("[ERROR] failed collecting hyperV ethernet metrics:", desc, err) + log.Error("failed collecting hyperV ethernet metrics:", desc, err) return err } return nil