Skip to content

Commit

Permalink
Change logger
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed Mar 18, 2024
1 parent 1584d00 commit 6b7e021
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/rdbms/scan/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/artie-labs/reader/lib/rdbms/primary_key"
"github.com/artie-labs/transfer/lib/retry"
"gorm.io/gorm/logger"

Check failure on line 10 in lib/rdbms/scan/scan.go

View workflow job for this annotation

GitHub Actions / test

no required module provides package gorm.io/gorm/logger; to add it:

Check failure on line 10 in lib/rdbms/scan/scan.go

View workflow job for this annotation

GitHub Actions / Postgres

no required module provides package gorm.io/gorm/logger; to add it:

Check failure on line 10 in lib/rdbms/scan/scan.go

View workflow job for this annotation

GitHub Actions / MySQL

no required module provides package gorm.io/gorm/logger; to add it:
)

const (
Expand Down Expand Up @@ -106,12 +107,7 @@ func (s *Scanner) Next() ([]map[string]any, error) {

func (s *Scanner) scan() ([]map[string]any, error) {
query, parameters := s.adapter.BuildQuery(s.primaryKeys.Keys(), s.isFirstBatch, s.batchSize)

logger := slog.With(slog.String("query", query))
if len(parameters) > 0 {
logger = logger.With(slog.Any("parameters", parameters))
}
logger.Info("Scan query")
logger.Info("Scan query", slog.String("query", query), slog.Any("parameters", parameters))

rows, err := retry.WithRetriesAndResult(s.retryCfg, func(_ int, _ error) (*sql.Rows, error) {
return s.db.Query(query, parameters...)
Expand Down

0 comments on commit 6b7e021

Please sign in to comment.