mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
Switch to prometheus/common/log for all logging
This commit is contained in:
@@ -2,10 +2,9 @@
|
||||
// <add link to documentation here> - {{ .Class }} class
|
||||
package collector
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/StackExchange/wmi"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/common/log"
|
||||
)
|
||||
func init() {
|
||||
Factories["{{ .CollectorName | toLower }}"] = New{{ .CollectorName }}Collector
|
||||
@@ -34,7 +33,7 @@ func New{{ .CollectorName }}Collector() (Collector, error) {
|
||||
// to the provided prometheus Metric channel.
|
||||
func (c *{{ .CollectorName }}Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
if desc, err := c.collect(ch); err != nil {
|
||||
log.Println("[ERROR] failed collecting {{ .CollectorName | toLower }} metrics:", desc, err)
|
||||
log.Error("failed collecting {{ .CollectorName | toLower }} metrics:", desc, err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user