diff --git a/pkg/innerring/blocktimer_test.go b/pkg/innerring/blocktimer_test.go index 9d02721c2..242c0903b 100644 --- a/pkg/innerring/blocktimer_test.go +++ b/pkg/innerring/blocktimer_test.go @@ -19,7 +19,7 @@ func TestEpochTimer(t *testing.T) { } args := &epochTimerArgs{ - l: test.NewLogger(t, true), + l: test.NewLogger(t), alphabetState: alphaState, newEpochHandlers: []newEpochHandler{neh.Handle}, cnrWrapper: cnrStopper, diff --git a/pkg/innerring/processors/alphabet/handlers_test.go b/pkg/innerring/processors/alphabet/handlers_test.go index f94c8e78d..346901949 100644 --- a/pkg/innerring/processors/alphabet/handlers_test.go +++ b/pkg/innerring/processors/alphabet/handlers_test.go @@ -48,7 +48,7 @@ func TestProcessorEmitsGasToNetmapAndAlphabet(t *testing.T) { params := &alphabet.Params{ ParsedWallets: parsedWallets, - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), PoolSize: 2, StorageEmission: emission, IRList: &testIndexer{index: index}, @@ -125,7 +125,7 @@ func TestProcessorEmitsGasToNetmapIfNoParsedWallets(t *testing.T) { params := &alphabet.Params{ ParsedWallets: parsedWallets, - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), PoolSize: 2, StorageEmission: emission, IRList: &testIndexer{index: index}, @@ -186,7 +186,7 @@ func TestProcessorDoesntEmitGasIfNoNetmapOrParsedWallets(t *testing.T) { params := &alphabet.Params{ ParsedWallets: parsedWallets, - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), PoolSize: 2, StorageEmission: emission, IRList: &testIndexer{index: index}, diff --git a/pkg/innerring/processors/balance/handlers_test.go b/pkg/innerring/processors/balance/handlers_test.go index 10ae8c60e..86a9e15d0 100644 --- a/pkg/innerring/processors/balance/handlers_test.go +++ b/pkg/innerring/processors/balance/handlers_test.go @@ -21,7 +21,7 @@ func TestProcessorCallsFrostFSContractForLockEvent(t *testing.T) { bsc := util.Uint160{100} processor, err := New(&Params{ - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), PoolSize: 2, FrostFSClient: cl, BalanceSC: bsc, @@ -47,7 +47,7 @@ func TestProcessorDoesntCallFrostFSContractIfNotAlphabet(t *testing.T) { bsc := util.Uint160{100} processor, err := New(&Params{ - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), PoolSize: 2, FrostFSClient: cl, BalanceSC: bsc, diff --git a/pkg/innerring/processors/container/handlers_test.go b/pkg/innerring/processors/container/handlers_test.go index 9fbfdf811..a69d0e4c4 100644 --- a/pkg/innerring/processors/container/handlers_test.go +++ b/pkg/innerring/processors/container/handlers_test.go @@ -38,7 +38,7 @@ func TestPutEvent(t *testing.T) { mc := &testMorphClient{} proc, err := New(&Params{ - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), PoolSize: 2, AlphabetState: &testAlphabetState{isAlphabet: true}, NetworkState: nst, @@ -99,7 +99,7 @@ func TestDeleteEvent(t *testing.T) { mc := &testMorphClient{} proc, err := New(&Params{ - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), PoolSize: 2, AlphabetState: &testAlphabetState{isAlphabet: true}, NetworkState: nst, @@ -171,7 +171,7 @@ func TestSetEACLEvent(t *testing.T) { mc := &testMorphClient{} proc, err := New(&Params{ - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), PoolSize: 2, AlphabetState: &testAlphabetState{isAlphabet: true}, NetworkState: nst, diff --git a/pkg/innerring/processors/frostfs/handlers_test.go b/pkg/innerring/processors/frostfs/handlers_test.go index 2685808ed..6425172bd 100644 --- a/pkg/innerring/processors/frostfs/handlers_test.go +++ b/pkg/innerring/processors/frostfs/handlers_test.go @@ -193,7 +193,7 @@ func TestHandleConfig(t *testing.T) { func newTestProc(t *testing.T, nonDefault func(p *Params)) (*Processor, error) { p := &Params{ - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), PoolSize: 1, FrostFSContract: util.Uint160{0}, BalanceClient: &testBalaceClient{}, diff --git a/pkg/innerring/processors/governance/handlers_test.go b/pkg/innerring/processors/governance/handlers_test.go index adf674173..2a505f8d1 100644 --- a/pkg/innerring/processors/governance/handlers_test.go +++ b/pkg/innerring/processors/governance/handlers_test.go @@ -42,7 +42,7 @@ func TestHandleAlphabetSyncEvent(t *testing.T) { proc, err := New( &Params{ - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), EpochState: es, AlphabetState: as, Voter: v, @@ -123,7 +123,7 @@ func TestHandleAlphabetDesignateEvent(t *testing.T) { proc, err := New( &Params{ - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), EpochState: es, AlphabetState: as, Voter: v, diff --git a/pkg/innerring/processors/netmap/handlers_test.go b/pkg/innerring/processors/netmap/handlers_test.go index 6a66fe323..b34abb78c 100644 --- a/pkg/innerring/processors/netmap/handlers_test.go +++ b/pkg/innerring/processors/netmap/handlers_test.go @@ -279,7 +279,7 @@ func newTestProc(t *testing.T, nonDefault func(p *Params)) (*Processor, error) { eh := &testEventHandler{} p := &Params{ - Log: test.NewLogger(t, true), + Log: test.NewLogger(t), PoolSize: 1, CleanupEnabled: false, CleanupThreshold: 3, diff --git a/pkg/local_object_storage/blobovnicza/blobovnicza_test.go b/pkg/local_object_storage/blobovnicza/blobovnicza_test.go index 8d701ae5c..caee770e8 100644 --- a/pkg/local_object_storage/blobovnicza/blobovnicza_test.go +++ b/pkg/local_object_storage/blobovnicza/blobovnicza_test.go @@ -63,7 +63,7 @@ func TestBlobovnicza(t *testing.T) { WithPath(p), WithObjectSizeLimit(objSizeLim), WithFullSizeLimit(sizeLim), - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), ) defer os.Remove(p) diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/concurrency_test.go b/pkg/local_object_storage/blobstor/blobovniczatree/concurrency_test.go index 24cb93865..350ebef54 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/concurrency_test.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/concurrency_test.go @@ -17,7 +17,7 @@ func TestBlobovniczaTree_Concurrency(t *testing.T) { const n = 1000 st := NewBlobovniczaTree( - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), WithObjectSizeLimit(1024), WithBlobovniczaShallowWidth(10), WithBlobovniczaShallowDepth(1), diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/exists_test.go b/pkg/local_object_storage/blobstor/blobovniczatree/exists_test.go index 63df97595..d50fb7983 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/exists_test.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/exists_test.go @@ -17,7 +17,7 @@ import ( func TestExistsInvalidStorageID(t *testing.T) { dir := t.TempDir() b := NewBlobovniczaTree( - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), WithObjectSizeLimit(1024), WithBlobovniczaShallowWidth(2), WithBlobovniczaShallowDepth(2), diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/generic_test.go b/pkg/local_object_storage/blobstor/blobovniczatree/generic_test.go index 6eb8b81ae..1a52eddf8 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/generic_test.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/generic_test.go @@ -13,7 +13,7 @@ func TestGeneric(t *testing.T) { helper := func(t *testing.T, dir string) common.Storage { return NewBlobovniczaTree( - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), WithObjectSizeLimit(maxObjectSize), WithBlobovniczaShallowWidth(2), WithBlobovniczaShallowDepth(2), @@ -40,7 +40,7 @@ func TestControl(t *testing.T) { newTree := func(t *testing.T) common.Storage { return NewBlobovniczaTree( - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), WithObjectSizeLimit(maxObjectSize), WithBlobovniczaShallowWidth(2), WithBlobovniczaShallowDepth(2), diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/rebuild_failover_test.go b/pkg/local_object_storage/blobstor/blobovniczatree/rebuild_failover_test.go index ff86c036a..855229405 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/rebuild_failover_test.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/rebuild_failover_test.go @@ -129,7 +129,7 @@ func testRebuildFailoverObjectDeletedFromSource(t *testing.T) { func testRebuildFailoverValidate(t *testing.T, dir string, obj *objectSDK.Object, mustUpdateStorageID bool) { b := NewBlobovniczaTree( - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), WithObjectSizeLimit(2048), WithBlobovniczaShallowWidth(2), WithBlobovniczaShallowDepth(2), diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/rebuild_test.go b/pkg/local_object_storage/blobstor/blobovniczatree/rebuild_test.go index 904971d25..0ac50f36a 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/rebuild_test.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/rebuild_test.go @@ -41,7 +41,7 @@ func TestBlobovniczaTreeRebuild(t *testing.T) { func testBlobovniczaTreeRebuildHelper(t *testing.T, sourceDepth, sourceWidth, targetDepth, targetWidth uint64, shouldMigrate bool) { dir := t.TempDir() b := NewBlobovniczaTree( - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), WithObjectSizeLimit(2048), WithBlobovniczaShallowWidth(sourceWidth), WithBlobovniczaShallowDepth(sourceDepth), @@ -81,7 +81,7 @@ func testBlobovniczaTreeRebuildHelper(t *testing.T, sourceDepth, sourceWidth, ta require.NoError(t, b.Close()) b = NewBlobovniczaTree( - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), WithObjectSizeLimit(2048), WithBlobovniczaShallowWidth(targetWidth), WithBlobovniczaShallowDepth(targetDepth), diff --git a/pkg/local_object_storage/blobstor/memstore/memstore_test.go b/pkg/local_object_storage/blobstor/memstore/memstore_test.go index eaa2a4b61..cabf7f5ad 100644 --- a/pkg/local_object_storage/blobstor/memstore/memstore_test.go +++ b/pkg/local_object_storage/blobstor/memstore/memstore_test.go @@ -15,7 +15,7 @@ import ( func TestSimpleLifecycle(t *testing.T) { s := New( WithRootPath("memstore"), - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), ) t.Cleanup(func() { _ = s.Close() }) require.NoError(t, s.Open(false)) diff --git a/pkg/local_object_storage/engine/control_test.go b/pkg/local_object_storage/engine/control_test.go index 21652970b..41b7db91c 100644 --- a/pkg/local_object_storage/engine/control_test.go +++ b/pkg/local_object_storage/engine/control_test.go @@ -49,7 +49,7 @@ func TestInitializationFailure(t *testing.T) { return []shard.Option{ shard.WithID(sid), - shard.WithLogger(test.NewLogger(t, true)), + shard.WithLogger(test.NewLogger(t)), shard.WithBlobStorOptions( blobstor.WithStorages(storages)), shard.WithMetaBaseOptions( @@ -289,7 +289,7 @@ func engineWithShards(t *testing.T, path string, num int) (*StorageEngine, []str te := testNewEngine(t). setShardsNumOpts(t, num, func(id int) []shard.Option { return []shard.Option{ - shard.WithLogger(test.NewLogger(t, true)), + shard.WithLogger(test.NewLogger(t)), shard.WithBlobStorOptions( blobstor.WithStorages(newStorages(filepath.Join(addPath, strconv.Itoa(id)), errSmallSize))), shard.WithMetaBaseOptions( diff --git a/pkg/local_object_storage/engine/delete_test.go b/pkg/local_object_storage/engine/delete_test.go index 8e94732ae..f3e4a0976 100644 --- a/pkg/local_object_storage/engine/delete_test.go +++ b/pkg/local_object_storage/engine/delete_test.go @@ -53,7 +53,7 @@ func TestDeleteBigObject(t *testing.T) { s3 := testNewShard(t, 3) e := testNewEngine(t).setInitializedShards(t, s1, s2, s3).engine - e.log = test.NewLogger(t, true) + e.log = test.NewLogger(t) defer e.Close(context.Background()) for i := range children { diff --git a/pkg/local_object_storage/engine/engine_test.go b/pkg/local_object_storage/engine/engine_test.go index 21bf37dc7..063ea451e 100644 --- a/pkg/local_object_storage/engine/engine_test.go +++ b/pkg/local_object_storage/engine/engine_test.go @@ -79,7 +79,7 @@ type testEngineWrapper struct { } func testNewEngine(t testing.TB, opts ...Option) *testEngineWrapper { - engine := New(WithLogger(test.NewLogger(t, true))) + engine := New(WithLogger(test.NewLogger(t))) for _, opt := range opts { opt(engine.cfg) } @@ -198,7 +198,7 @@ func testNewShard(t testing.TB, id int) *shard.Shard { func testDefaultShardOptions(t testing.TB, id int) []shard.Option { return []shard.Option{ - shard.WithLogger(test.NewLogger(t, true)), + shard.WithLogger(test.NewLogger(t)), shard.WithBlobStorOptions( blobstor.WithStorages( newStorages(t.TempDir(), 1<<20))), diff --git a/pkg/local_object_storage/engine/error_test.go b/pkg/local_object_storage/engine/error_test.go index cf62302f2..3f343e5b9 100644 --- a/pkg/local_object_storage/engine/error_test.go +++ b/pkg/local_object_storage/engine/error_test.go @@ -55,7 +55,7 @@ func newEngineWithErrorThreshold(t testing.TB, dir string, errThreshold uint32) largeFileStorage: largeFileStorage, } return []shard.Option{ - shard.WithLogger(test.NewLogger(t, true)), + shard.WithLogger(test.NewLogger(t)), shard.WithBlobStorOptions(blobstor.WithStorages(storages)), shard.WithMetaBaseOptions( meta.WithPath(filepath.Join(dir, fmt.Sprintf("%d.metabase", id))), diff --git a/pkg/local_object_storage/engine/evacuate_test.go b/pkg/local_object_storage/engine/evacuate_test.go index 13ba94f5b..ca86ef544 100644 --- a/pkg/local_object_storage/engine/evacuate_test.go +++ b/pkg/local_object_storage/engine/evacuate_test.go @@ -30,7 +30,7 @@ func newEngineEvacuate(t *testing.T, shardNum int, objPerShard int) (*StorageEng te := testNewEngine(t). setShardsNumOpts(t, shardNum, func(id int) []shard.Option { return []shard.Option{ - shard.WithLogger(test.NewLogger(t, true)), + shard.WithLogger(test.NewLogger(t)), shard.WithBlobStorOptions( blobstor.WithStorages([]blobstor.SubStorage{{ Storage: fstree.New( diff --git a/pkg/local_object_storage/engine/list_test.go b/pkg/local_object_storage/engine/list_test.go index 246118687..27c6c819f 100644 --- a/pkg/local_object_storage/engine/list_test.go +++ b/pkg/local_object_storage/engine/list_test.go @@ -65,7 +65,7 @@ func TestListWithCursor(t *testing.T) { t.Parallel() e := testNewEngine(t).setShardsNumOpts(t, tt.shardNum, func(id int) []shard.Option { return []shard.Option{ - shard.WithLogger(test.NewLogger(t, true)), + shard.WithLogger(test.NewLogger(t)), shard.WithBlobStorOptions( blobstor.WithStorages( newStorages(t.TempDir(), 1<<20))), diff --git a/pkg/local_object_storage/shard/control_test.go b/pkg/local_object_storage/shard/control_test.go index 8a650db0c..4d7354595 100644 --- a/pkg/local_object_storage/shard/control_test.go +++ b/pkg/local_object_storage/shard/control_test.go @@ -64,7 +64,7 @@ func TestShardOpen(t *testing.T) { newShard := func() *Shard { return New( WithID(NewIDFromBytes([]byte{})), - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), WithBlobStorOptions( blobstor.WithStorages([]blobstor.SubStorage{ {Storage: st}, diff --git a/pkg/local_object_storage/shard/gc_internal_test.go b/pkg/local_object_storage/shard/gc_internal_test.go index b64cb9c40..a82fc3ffe 100644 --- a/pkg/local_object_storage/shard/gc_internal_test.go +++ b/pkg/local_object_storage/shard/gc_internal_test.go @@ -30,13 +30,13 @@ func Test_ObjectNotFoundIfNotDeletedFromMetabase(t *testing.T) { rootPath := t.TempDir() var sh *Shard - l := test.NewLogger(t, true) + l := test.NewLogger(t) blobOpts := []blobstor.Option{ - blobstor.WithLogger(test.NewLogger(t, true)), + blobstor.WithLogger(test.NewLogger(t)), blobstor.WithStorages([]blobstor.SubStorage{ { Storage: blobovniczatree.NewBlobovniczaTree( - blobovniczatree.WithLogger(test.NewLogger(t, true)), + blobovniczatree.WithLogger(test.NewLogger(t)), blobovniczatree.WithRootPath(filepath.Join(rootPath, "blob", "blobovnicza")), blobovniczatree.WithBlobovniczaShallowDepth(1), blobovniczatree.WithBlobovniczaShallowWidth(1)), diff --git a/pkg/local_object_storage/shard/range_test.go b/pkg/local_object_storage/shard/range_test.go index 35dc0c6a5..28bbd30e5 100644 --- a/pkg/local_object_storage/shard/range_test.go +++ b/pkg/local_object_storage/shard/range_test.go @@ -78,7 +78,7 @@ func testShardGetRange(t *testing.T, hasWriteCache bool) { blobstor.WithStorages([]blobstor.SubStorage{ { Storage: blobovniczatree.NewBlobovniczaTree( - blobovniczatree.WithLogger(test.NewLogger(t, true)), + blobovniczatree.WithLogger(test.NewLogger(t)), blobovniczatree.WithRootPath(filepath.Join(t.TempDir(), "blob", "blobovnicza")), blobovniczatree.WithBlobovniczaShallowDepth(1), blobovniczatree.WithBlobovniczaShallowWidth(1)), diff --git a/pkg/local_object_storage/shard/reload_test.go b/pkg/local_object_storage/shard/reload_test.go index fc1fc2d20..c76fc1a00 100644 --- a/pkg/local_object_storage/shard/reload_test.go +++ b/pkg/local_object_storage/shard/reload_test.go @@ -27,7 +27,7 @@ func TestShardReload(t *testing.T) { p := t.Name() defer os.RemoveAll(p) - l := test.NewLogger(t, true) + l := test.NewLogger(t) blobOpts := []blobstor.Option{ blobstor.WithLogger(l), blobstor.WithStorages([]blobstor.SubStorage{ diff --git a/pkg/local_object_storage/shard/shard_test.go b/pkg/local_object_storage/shard/shard_test.go index 807633cd5..98d1c7b8e 100644 --- a/pkg/local_object_storage/shard/shard_test.go +++ b/pkg/local_object_storage/shard/shard_test.go @@ -56,11 +56,11 @@ func newCustomShard(t testing.TB, enableWriteCache bool, o shardOptions) *Shard if o.bsOpts == nil { o.bsOpts = []blobstor.Option{ - blobstor.WithLogger(test.NewLogger(t, true)), + blobstor.WithLogger(test.NewLogger(t)), blobstor.WithStorages([]blobstor.SubStorage{ { Storage: blobovniczatree.NewBlobovniczaTree( - blobovniczatree.WithLogger(test.NewLogger(t, true)), + blobovniczatree.WithLogger(test.NewLogger(t)), blobovniczatree.WithRootPath(filepath.Join(o.rootPath, "blob", "blobovnicza")), blobovniczatree.WithBlobovniczaShallowDepth(1), blobovniczatree.WithBlobovniczaShallowWidth(1)), @@ -78,7 +78,7 @@ func newCustomShard(t testing.TB, enableWriteCache bool, o shardOptions) *Shard opts := []Option{ WithID(NewIDFromBytes([]byte{})), - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), WithBlobStorOptions(o.bsOpts...), WithMetaBaseOptions( append([]meta.Option{ diff --git a/pkg/local_object_storage/writecache/flush_test.go b/pkg/local_object_storage/writecache/flush_test.go index 4a243c5ec..a358028e7 100644 --- a/pkg/local_object_storage/writecache/flush_test.go +++ b/pkg/local_object_storage/writecache/flush_test.go @@ -24,7 +24,7 @@ import ( ) func TestFlush(t *testing.T) { - testlogger := test.NewLogger(t, true) + testlogger := test.NewLogger(t) createCacheFn := func(t *testing.T, smallSize uint64, mb *meta.DB, bs MainStorage, opts ...Option) Cache { return New( diff --git a/pkg/local_object_storage/writecache/generic_test.go b/pkg/local_object_storage/writecache/generic_test.go index a6d9e4799..2913ed13b 100644 --- a/pkg/local_object_storage/writecache/generic_test.go +++ b/pkg/local_object_storage/writecache/generic_test.go @@ -10,7 +10,7 @@ import ( func TestGeneric(t *testing.T) { storagetest.TestAll(t, func(t *testing.T) storagetest.Component { return New( - WithLogger(test.NewLogger(t, true)), + WithLogger(test.NewLogger(t)), WithFlushWorkersCount(2), WithPath(t.TempDir())) }) diff --git a/pkg/morph/event/listener_test.go b/pkg/morph/event/listener_test.go index ae92bd580..5f7cf9f43 100644 --- a/pkg/morph/event/listener_test.go +++ b/pkg/morph/event/listener_test.go @@ -20,7 +20,7 @@ func TestEventHandling(t *testing.T) { notaryRequestsCh := make(chan *result.NotaryRequestEvent) l, err := NewListener(ListenerParams{ - Logger: test.NewLogger(t, true), + Logger: test.NewLogger(t), Subscriber: &testSubscriber{ blockCh: blockCh, notificationCh: notificationCh, @@ -102,7 +102,7 @@ func TestErrorPassing(t *testing.T) { t.Run("notification error", func(t *testing.T) { nErr := fmt.Errorf("notification error") l, err := NewListener(ListenerParams{ - Logger: test.NewLogger(t, true), + Logger: test.NewLogger(t), Subscriber: &testSubscriber{ blockCh: blockCh, notificationCh: notificationCh, @@ -126,7 +126,7 @@ func TestErrorPassing(t *testing.T) { t.Run("block error", func(t *testing.T) { bErr := fmt.Errorf("notification error") l, err := NewListener(ListenerParams{ - Logger: test.NewLogger(t, true), + Logger: test.NewLogger(t), Subscriber: &testSubscriber{ blockCh: blockCh, notificationCh: notificationCh, diff --git a/pkg/services/object/get/get_test.go b/pkg/services/object/get/get_test.go index f4d4f7372..64614d8d8 100644 --- a/pkg/services/object/get/get_test.go +++ b/pkg/services/object/get/get_test.go @@ -270,7 +270,7 @@ func TestGetLocalOnly(t *testing.T) { newSvc := func(storage *testStorage) *Service { return &Service{ - log: test.NewLogger(t, true), + log: test.NewLogger(t), localStorage: storage, } } @@ -532,7 +532,7 @@ func TestGetRemoteSmall(t *testing.T) { const curEpoch = 13 return &Service{ - log: test.NewLogger(t, true), + log: test.NewLogger(t), localStorage: newTestStorage(), traverserGenerator: &testTraverserGenerator{ c: cnr, @@ -1663,7 +1663,7 @@ func TestGetFromPastEpoch(t *testing.T) { const curEpoch = 13 svc := &Service{ - log: test.NewLogger(t, true), + log: test.NewLogger(t), localStorage: newTestStorage(), epochSource: testEpochReceiver(curEpoch), traverserGenerator: &testTraverserGenerator{ diff --git a/pkg/services/object/search/search_test.go b/pkg/services/object/search/search_test.go index 09d98eff2..802fa33ef 100644 --- a/pkg/services/object/search/search_test.go +++ b/pkg/services/object/search/search_test.go @@ -161,7 +161,7 @@ func TestGetLocalOnly(t *testing.T) { newSvc := func(storage *testStorage) *Service { svc := &Service{cfg: new(cfg)} - svc.log = test.NewLogger(t, true) + svc.log = test.NewLogger(t) svc.localStorage = storage return svc @@ -277,7 +277,7 @@ func TestGetRemoteSmall(t *testing.T) { newSvc := func(b *testPlacementBuilder, c *testClientCache) *Service { svc := &Service{cfg: new(cfg)} - svc.log = test.NewLogger(t, true) + svc.log = test.NewLogger(t) svc.localStorage = newTestStorage() const curEpoch = 13 @@ -430,7 +430,7 @@ func TestGetFromPastEpoch(t *testing.T) { c22.addResult(idCnr, ids22, nil) svc := &Service{cfg: new(cfg)} - svc.log = test.NewLogger(t, true) + svc.log = test.NewLogger(t) svc.localStorage = newTestStorage() const curEpoch = 13 @@ -543,7 +543,7 @@ func TestGetWithSessionToken(t *testing.T) { w := new(simpleIDWriter) svc := &Service{cfg: new(cfg)} - svc.log = test.NewLogger(t, true) + svc.log = test.NewLogger(t) svc.localStorage = localStorage const curEpoch = 13 diff --git a/pkg/services/tree/signature_test.go b/pkg/services/tree/signature_test.go index 1449d5756..b55f4d4fc 100644 --- a/pkg/services/tree/signature_test.go +++ b/pkg/services/tree/signature_test.go @@ -100,7 +100,7 @@ func TestMessageSign(t *testing.T) { s := &Service{ cfg: cfg{ - log: test.NewLogger(t, true), + log: test.NewLogger(t), key: &privs[0].PrivateKey, nmSource: dummyNetmapSource{}, cnrSource: dummyContainerSource{ diff --git a/pkg/util/logger/test/logger.go b/pkg/util/logger/test/logger.go index 4a2870870..dd07e6170 100644 --- a/pkg/util/logger/test/logger.go +++ b/pkg/util/logger/test/logger.go @@ -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 }