From 94b21b286edff37496a2fe481963625ac01c30a1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 1 Jul 2024 22:15:06 +0200 Subject: feat: more structured logging --- internal/importer/main_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'internal/importer/main_test.go') diff --git a/internal/importer/main_test.go b/internal/importer/main_test.go index cb4d1db..0bc438d 100644 --- a/internal/importer/main_test.go +++ b/internal/importer/main_test.go @@ -1,26 +1,27 @@ package importer import ( - "log/slog" "testing" "go.alanpearce.eu/searchix/internal/config" "go.alanpearce.eu/searchix/internal/index" + "go.alanpearce.eu/x/log" ) var cfg = config.DefaultConfig func BenchmarkImporterLowMemory(b *testing.B) { tmp := b.TempDir() - cfg.LogLevel = slog.LevelDebug + logger := log.Configure(false) _, write, _, err := index.OpenOrCreate(tmp, false, &index.Options{ LowMemory: true, + Logger: logger.Named("index"), }) if err != nil { b.Fatal(err) } - err = Start(&cfg, write, false, &[]string{"nixpkgs"}) + err = Start(&cfg, logger.Named("importer"), write, false, &[]string{"nixpkgs"}) if err != nil { b.Fatal(err) } -- cgit 1.4.1