error-pages/internal/logger/std_test.go

24 lines
368 B
Go
Raw Normal View History

2024-07-03 14:12:13 +00:00
package logger_test
import (
"bytes"
"testing"
"github.com/stretchr/testify/assert"
"gh.tarampamp.am/error-pages/internal/logger"
)
func TestNewStdLog(t *testing.T) {
var (
buf bytes.Buffer
log, _ = logger.New(logger.InfoLevel, logger.JSONFormat, &buf)
std = logger.NewStdLog(log)
)
std.Print("test")
assert.Contains(t, buf.String(), "test")
}