github.com/gramework/gramework@v1.8.1-0.20231027140105-82555c9057f5/test/log_test.go (about) 1 package test 2 3 import ( 4 "testing" 5 6 "github.com/apex/log" 7 "github.com/gramework/gramework" 8 ) 9 10 func TestLogErrorfShouldNotPanic(t *testing.T) { 11 defer func() { 12 e := recover() 13 if e != nil { 14 t.Logf("panic handled while testing log.errorf: %+#v", e) 15 t.FailNow() 16 } 17 }() 18 gramework.Errorf("test: %v", []string{"test"}) 19 } 20 21 func TestFastHTTPLoggerAdapter(t *testing.T) { 22 var apexLogger log.Interface = gramework.Logger 23 logger := gramework.NewFastHTTPLoggerAdapter(&apexLogger) 24 logger.Printf("printed") 25 }