[#895] test: Fix NewLogger arguments list
`debug` is always true. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
a8e52ef7aa
commit
f1b2b8bffa
32 changed files with 60 additions and 65 deletions
|
@ -10,20 +10,15 @@ import (
|
|||
)
|
||||
|
||||
// NewLogger creates a new logger.
|
||||
//
|
||||
// If debug, development logger is created.
|
||||
func NewLogger(t testing.TB, debug bool) *logger.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 = zap.L()
|
||||
|
||||
if debug {
|
||||
cfg := zap.NewDevelopmentConfig()
|
||||
cfg.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder
|
||||
|
||||
log, err := cfg.Build()
|
||||
require.NoError(t, err, "could not prepare logger")
|
||||
l.Logger = log
|
||||
}
|
||||
l.Logger = log
|
||||
|
||||
return &l
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue