From eaaddf33417084ae180c984af616334f5b9cd969 Mon Sep 17 00:00:00 2001 From: Marvin Preuss Date: Wed, 5 Apr 2023 09:29:15 +0000 Subject: [PATCH] feat(logging): debug with extracted values --- internal/dirtoexcel/dirtoexcel.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/dirtoexcel/dirtoexcel.go b/internal/dirtoexcel/dirtoexcel.go index 40f4143..a07fb21 100644 --- a/internal/dirtoexcel/dirtoexcel.go +++ b/internal/dirtoexcel/dirtoexcel.go @@ -76,7 +76,11 @@ func Create(out, dir string) error { return fmt.Errorf("strange numbers of matches") } - if err := f.SetCellStr("Sheet1", fmt.Sprintf("A%d", i+1), res[0][1]); err != nil { + company := res[0][1] + + log.Debug("extracted", slog.String("company", company)) + + if err := f.SetCellStr("Sheet1", fmt.Sprintf("A%d", i+1), company); err != nil { return fmt.Errorf("failed to set cell: %w", err) } @@ -85,7 +89,11 @@ func Create(out, dir string) error { return fmt.Errorf("failed to parse value: %w", err) } - if err := f.SetCellValue("Sheet1", fmt.Sprintf("B%d", i+1), math.Round(value*100)/100); err != nil { + rValue := math.Round(value*100) / 100 + + log.Debug("extracted", slog.Float64("value", rValue)) + + if err := f.SetCellValue("Sheet1", fmt.Sprintf("B%d", i+1), rValue); err != nil { return fmt.Errorf("failed to set cell: %w", err) }