Dmitrii Stepanov
f1b2b8bffa
`debug` is always true. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
24 lines
498 B
Go
24 lines
498 B
Go
package test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
|
|
"github.com/stretchr/testify/require"
|
|
"go.uber.org/zap"
|
|
"go.uber.org/zap/zapcore"
|
|
)
|
|
|
|
// NewLogger creates a new logger.
|
|
func NewLogger(t testing.TB) *logger.Logger {
|
|
cfg := zap.NewDevelopmentConfig()
|
|
cfg.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder
|
|
|
|
log, err := cfg.Build()
|
|
require.NoError(t, err, "could not prepare logger")
|
|
|
|
var l logger.Logger
|
|
l.Logger = log
|
|
|
|
return &l
|
|
}
|