Switch logging from glog to github.com/prometheus/log.

This commit is contained in:
Julius Volz 2015-05-28 21:21:44 +02:00
commit e65bc868fc
13 changed files with 36 additions and 44 deletions

View file

@ -10,8 +10,8 @@ import (
"strings"
"time"
"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/log"
)
const lastLoginSubsystem = "last_login"
@ -28,7 +28,6 @@ func init() {
// load, seconds since last login and a list of tags as specified by config.
func NewLastLoginCollector() (Collector, error) {
return &lastLoginCollector{
metric: prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: Namespace,
Subsystem: lastLoginSubsystem,
@ -43,7 +42,7 @@ func (c *lastLoginCollector) Update(ch chan<- prometheus.Metric) (err error) {
if err != nil {
return fmt.Errorf("Couldn't get last seen: %s", err)
}
glog.V(1).Infof("Set node_last_login_time: %f", last)
log.Debugf("Set node_last_login_time: %f", last)
c.metric.Set(last)
c.metric.Collect(ch)
return err