From c5826156af009f508a7b2d1efddd9f97d3e2cfd4 Mon Sep 17 00:00:00 2001 From: Martin Hansen Date: Mon, 16 Sep 2024 20:07:26 +0200 Subject: [PATCH] fix: easier to read log messages commit-id:607ba380 --- reader/nordigen/nordigen.go | 7 ++----- writer/ynab/ynab.go | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/reader/nordigen/nordigen.go b/reader/nordigen/nordigen.go index 224b467..93d044e 100644 --- a/reader/nordigen/nordigen.go +++ b/reader/nordigen/nordigen.go @@ -29,10 +29,7 @@ func NewReader(cfg *ynabber.Config) Reader { return Reader{ Config: cfg, Client: client, - logger: slog.Default().With( - "reader", "nordigen", - "bank_id", cfg.Nordigen.BankID, - ), + logger: slog.Default().With("reader", "nordigen"), } } @@ -78,7 +75,7 @@ func (r Reader) Bulk() (t []ynabber.Transaction, err error) { return nil, fmt.Errorf("failed to authorize: %w", err) } - r.logger.Info("", "accounts", len(req.Accounts)) + r.logger.Info("loaded requisition", "accounts", len(req.Accounts)) for _, account := range req.Accounts { accountMetadata, err := r.Client.GetAccountMetadata(account) if err != nil { diff --git a/writer/ynab/ynab.go b/writer/ynab/ynab.go index 5a95054..327707c 100644 --- a/writer/ynab/ynab.go +++ b/writer/ynab/ynab.go @@ -192,9 +192,9 @@ func (w Writer) Bulk(t []ynabber.Transaction) error { return fmt.Errorf("failed to send request: %s", res.Status) } else { w.logger.Info( - "Request sent", + "sent transactions", "status", - res.Status, + res.StatusCode, "transactions", len(y.Transactions), "skipped",