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/importer/package.go | |
parent | f076b5bd6cb82edd99be50f3dbdd39bb9be2c44e (diff) | |
download | searchix-94b21b286edff37496a2fe481963625ac01c30a1.tar.lz searchix-94b21b286edff37496a2fe481963625ac01c30a1.tar.zst searchix-94b21b286edff37496a2fe481963625ac01c30a1.zip |
feat: more structured logging
Diffstat (limited to 'internal/importer/package.go')
-rw-r--r-- | internal/importer/package.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/importer/package.go b/internal/importer/package.go index 5a0ea00..80adc38 100644 --- a/internal/importer/package.go +++ b/internal/importer/package.go @@ -9,6 +9,7 @@ import ( "go.alanpearce.eu/searchix/internal/config" "go.alanpearce.eu/searchix/internal/nix" + "go.alanpearce.eu/x/log" "github.com/bcicen/jstream" "github.com/mitchellh/mapstructure" @@ -40,6 +41,7 @@ type maintainerJSON struct { type PackageIngester struct { dec *jstream.Decoder ms *mapstructure.Decoder + log *log.Logger pkg packageJSON infile io.ReadCloser source *config.Source @@ -60,9 +62,14 @@ func makeAdhocPlatform(v any) string { return string(s) } -func NewPackageProcessor(infile io.ReadCloser, source *config.Source) (*PackageIngester, error) { +func NewPackageProcessor( + infile io.ReadCloser, + source *config.Source, + log *log.Logger, +) (*PackageIngester, error) { i := &PackageIngester{ dec: jstream.NewDecoder(infile, 2).EmitKV(), + log: log, pkg: packageJSON{}, infile: infile, source: source, |