Codebase list golang-github-go-kit-kit / lintian-fixes/main log / nop_logger_test.go
lintian-fixes/main

Tree @lintian-fixes/main (Download .tar.gz)

nop_logger_test.go @lintian-fixes/main

87d3373
 
 
 
 
 
 
 
 
22fe74f
87d3373
 
 
 
055e4ba
87d3373
 
 
7388193
 
 
 
 
 
 
 
package log_test

import (
	"testing"

	"github.com/go-kit/kit/log"
)

func TestNopLogger(t *testing.T) {
	t.Parallel()
	logger := log.NewNopLogger()
	if err := logger.Log("abc", 123); err != nil {
		t.Error(err)
	}
	if err := log.With(logger, "def", "ghi").Log(); err != nil {
		t.Error(err)
	}
}

func BenchmarkNopLoggerSimple(b *testing.B) {
	benchmarkRunner(b, log.NewNopLogger(), baseMessage)
}

func BenchmarkNopLoggerContextual(b *testing.B) {
	benchmarkRunner(b, log.NewNopLogger(), withMessage)
}