switch to go-kit/log (#1575)
Signed-off-by: yeya24 <yb532204897@gmail.com>
This commit is contained in:
parent
a80b7d0bc5
commit
2477c5c67d
158 changed files with 3434 additions and 4636 deletions
|
|
@ -20,6 +20,7 @@ import (
|
|||
"fmt"
|
||||
"regexp"
|
||||
|
||||
"github.com/go-kit/kit/log"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/procfs/sysfs"
|
||||
"gopkg.in/alecthomas/kingpin.v2"
|
||||
|
|
@ -33,18 +34,20 @@ type powerSupplyClassCollector struct {
|
|||
subsystem string
|
||||
ignoredPattern *regexp.Regexp
|
||||
metricDescs map[string]*prometheus.Desc
|
||||
logger log.Logger
|
||||
}
|
||||
|
||||
func init() {
|
||||
registerCollector("powersupplyclass", defaultEnabled, NewPowerSupplyClassCollector)
|
||||
}
|
||||
|
||||
func NewPowerSupplyClassCollector() (Collector, error) {
|
||||
func NewPowerSupplyClassCollector(logger log.Logger) (Collector, error) {
|
||||
pattern := regexp.MustCompile(*powerSupplyClassIgnoredPowerSupplies)
|
||||
return &powerSupplyClassCollector{
|
||||
subsystem: "power_supply",
|
||||
ignoredPattern: pattern,
|
||||
metricDescs: map[string]*prometheus.Desc{},
|
||||
logger: logger,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue