58
// NewTestLogger returns a logger for tests
59
// Deprecated: Use testlogger.TestLogger instead.
61
>
format := os.Getenv(TestLogFormatEnvVar)
62
>
if format == "" {
63
>
format = "console"
64
>
}
65
67
>
Level: os.Getenv(TestLogLevelEnvVar),
68
>
Format: format,
69
>
Development: true,
70
>
})
71
>
72
>
// Don't include stack traces for warnings during tests. Only include them for logs with level error and above.
73
>
logger = logger.WithOptions(zap.AddStacktrace(zap.ErrorLevel))
74
>
75
>
return NewZapLogger(logger)
76
}
77