From c3ea735c0f03a0827a8e753a5b5adf6e31f4c925 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Tue, 24 Oct 2023 19:12:52 +0200 Subject: feat: Migrate from logrus to slog --- pkg/worker/list_processor_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'pkg/worker/list_processor_test.go') diff --git a/pkg/worker/list_processor_test.go b/pkg/worker/list_processor_test.go index abdb907..21489e8 100644 --- a/pkg/worker/list_processor_test.go +++ b/pkg/worker/list_processor_test.go @@ -5,12 +5,11 @@ package worker import ( "context" "errors" + "log/slog" "math/rand" "sync" "testing" - "github.com/sirupsen/logrus" - "git.sr.ht/~gabrielgio/img/pkg/testkit" ) @@ -27,12 +26,12 @@ type ( func TestListProcessorLimit(t *testing.T) { var ( - log = logrus.New() + log = slog.Default() scheduler = NewScheduler(1) mock = &mockCounterListProcessor{countTo: 10000} ) - worker := NewTaskFromBatchProcessor[int](mock, scheduler, log.WithField("context", "testing")) + worker := NewTaskFromBatchProcessor[int](mock, scheduler, log.With("context", "testing")) err := worker.Start(context.Background()) testkit.TestFatalError(t, "Start", err) @@ -42,12 +41,12 @@ func TestListProcessorLimit(t *testing.T) { func TestListProcessorContextCancelQuery(t *testing.T) { var ( - log = logrus.New() + log = slog.Default() scheduler = NewScheduler(1) mock = &mockContextListProcessor{} ) - worker := NewTaskFromBatchProcessor[int](mock, scheduler, log.WithField("context", "testing")) + worker := NewTaskFromBatchProcessor[int](mock, scheduler, log.With("context", "testing")) ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup -- cgit v1.2.3