frostfs-node/pkg/util/logger/test/logger.go
Dmitrii Stepanov 836818fb75 [#895] test: Use zaptest logger
Previous implementation mixes logs from different tests, now logs
are separeted by test.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-01-11 12:32:09 +00:00

19 lines
417 B
Go

package test
import (
"testing"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"go.uber.org/zap/zaptest"
)
// NewLogger creates a new logger.
func NewLogger(t testing.TB) *logger.Logger {
var l logger.Logger
l.Logger = zaptest.NewLogger(t,
zaptest.Level(zapcore.DebugLevel),
zaptest.WrapOptions(zap.Development(), zap.AddCaller()))
return &l
}