private/testplanet: expose NewLogger for other tests

NewLogger contains bunch of logic that is useful for creating
a nice logger.

Change-Id: Idad57525d334f40b3faa70dbc4737b114992b0a4
This commit is contained in:
Egon Elbre 2022-01-27 13:56:27 +02:00
parent b8c55fdd87
commit a1aa9f24ed
2 changed files with 3 additions and 2 deletions

View File

@ -17,7 +17,8 @@ import (
var useAbsTime = os.Getenv("STORJ_TESTPLANET_ABSTIME")
func newLogger(t *testing.T) *zap.Logger {
// NewLogger creates a zaptest logger with nice defaults for tests.
func NewLogger(t *testing.T) *zap.Logger {
if useAbsTime != "" {
return zaptest.NewLogger(t)
}

View File

@ -40,7 +40,7 @@ func Run(t *testing.T, config Config, test func(t *testing.T, ctx *testcontext.C
planetConfig.Name = t.Name()
}
log := newLogger(t)
log := NewLogger(t)
testmonkit.Run(context.Background(), t, func(parent context.Context) {
defer pprof.SetGoroutineLabels(parent)