cmd/promtool: use log.NewNopLogger() (#5531)

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
Simon Pasquier 2019-05-03 11:00:07 +02:00 committed by Brian Brazil
parent 03b90b4645
commit 9c69eec82a
2 changed files with 13 additions and 18 deletions

View file

@ -25,6 +25,7 @@ import (
"strings"
"time"
"github.com/go-kit/kit/log"
"github.com/pkg/errors"
yaml "gopkg.in/yaml.v2"
@ -160,7 +161,7 @@ func (tg *testGroup) test(mint, maxt time.Time, evalInterval time.Duration, grou
Appendable: suite.Storage(),
Context: context.Background(),
NotifyFunc: func(ctx context.Context, expr string, alerts ...*rules.Alert) {},
Logger: &dummyLogger{},
Logger: log.NewNopLogger(),
}
m := rules.NewManager(opts)
// TODO(beorn7): Provide a way to pass in external labels.
@ -502,9 +503,3 @@ func parsedSamplesString(pss []parsedSample) string {
func (ps *parsedSample) String() string {
return ps.Labels.String() + " " + strconv.FormatFloat(ps.Value, 'E', -1, 64)
}
type dummyLogger struct{}
func (l *dummyLogger) Log(keyvals ...interface{}) error {
return nil
}