vitess.io/vitess@v0.16.2/go/vt/vtgr/log/log_test.go (about) 1 package log 2 3 import ( 4 "fmt" 5 "testing" 6 7 "github.com/stretchr/testify/assert" 8 ) 9 10 func TestVTGRLogger(t *testing.T) { 11 logger := NewVTGRLogger("ks", "0") 12 s1 := logger.annotate("abc") 13 assert.Equal(t, "shard=ks/0 abc", s1) 14 s2 := fmt.Sprintf(logger.annotate("abc %s"), "def") 15 assert.Equal(t, "shard=ks/0 abc def", s2) 16 }