diff options
author | Alan Pearce | 2024-07-01 22:15:06 +0200 |
---|---|---|
committer | Alan Pearce | 2024-07-01 22:15:06 +0200 |
commit | 94b21b286edff37496a2fe481963625ac01c30a1 (patch) | |
tree | bdfd7803dd4eb22da785331b8547ff9858e2b0e6 /internal/fetcher/download.go | |
parent | f076b5bd6cb82edd99be50f3dbdd39bb9be2c44e (diff) | |
download | searchix-94b21b286edff37496a2fe481963625ac01c30a1.tar.lz searchix-94b21b286edff37496a2fe481963625ac01c30a1.tar.zst searchix-94b21b286edff37496a2fe481963625ac01c30a1.zip |
feat: more structured logging
Diffstat (limited to 'internal/fetcher/download.go')
-rw-r--r-- | internal/fetcher/download.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/fetcher/download.go b/internal/fetcher/download.go index 941a683..a34c838 100644 --- a/internal/fetcher/download.go +++ b/internal/fetcher/download.go @@ -3,24 +3,24 @@ package fetcher import ( "context" "fmt" - "log/slog" "net/url" "go.alanpearce.eu/searchix/internal/config" "go.alanpearce.eu/searchix/internal/index" "github.com/pkg/errors" + "go.alanpearce.eu/x/log" ) type DownloadFetcher struct { Source *config.Source SourceFile string - Logger *slog.Logger + Logger *log.Logger } func NewDownloadFetcher( source *config.Source, - logger *slog.Logger, + logger *log.Logger, ) (*DownloadFetcher, error) { switch source.Importer { case config.Options: @@ -59,7 +59,7 @@ func (i *DownloadFetcher) FetchIfNeeded( i.Logger.Debug("preparing to fetch URL", "url", fetchURL) - body, mtime, err := fetchFileIfNeeded(ctx, sourceUpdated, fetchURL) + body, mtime, err := fetchFileIfNeeded(ctx, i.Logger, sourceUpdated, fetchURL) if err != nil { i.Logger.Warn("failed to fetch file", "url", fetchURL, "error", err) |