Skip to content

Commit

Permalink
fix: easier to read log messages
Browse files Browse the repository at this point in the history
commit-id:607ba380
  • Loading branch information
martinohansen committed Sep 16, 2024
1 parent dfd2755 commit 816e348
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions reader/nordigen/nordigen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}

Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions writer/ynab/ynab.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 816e348

Please sign in to comment.