status-go/logutils/logger_test.go

21 lines
370 B
Go
Raw Normal View History

2023-11-09 06:35:59 +00:00
package logutils
import (
"bytes"
"testing"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zapcore"
2023-11-09 06:35:59 +00:00
)
func TestPrintOrigins(t *testing.T) {
buffer := bytes.NewBuffer(nil)
logger := defaultLogger()
logger.Core().(*Core).UpdateSyncer(zapcore.AddSync(buffer))
logger.Info("hello")
require.Contains(t, buffer.String(), "logutils/logger_test.go:17")
2023-11-09 06:35:59 +00:00
}