Skip to content

Amend backend logs to have correct parameters #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/bigquery/driver/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func prepareQuery(query string, args []driver.Value) (out string, err error) {
query = strings.Replace(query, "?", fmt.Sprintf("FROM_BASE64('%s')", data64), 1)
}
default:
log.DefaultLogger.Info("unknown type: %s", reflect.TypeOf(value).String())
log.DefaultLogger.Warn(fmt.Sprintf("Unknown query arg type: %s", reflect.TypeOf(value).String()))
query = strings.Replace(query, "?", fmt.Sprintf("'%s'", value), 1)
}

Expand Down Expand Up @@ -204,7 +204,7 @@ func (c *Conn) Ping(ctx context.Context) (err error) {
return
}

log.DefaultLogger.Info("Successful Ping", job.LastStatus().State)
log.DefaultLogger.Info("Successful Ping", "status", job.LastStatus().State)
return
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/bigquery/driver/stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (s *stmt) NumInput() int {

// Deprecated: Drivers should implement StmtExecContext instead (or additionally).
func (s *stmt) Exec(args []driver.Value) (driver.Result, error) {
log.DefaultLogger.Debug("Got stmt.Exec", s.query)
log.DefaultLogger.Debug("Got stmt.Exec", "query", s.query)
return s.c.Exec(s.query, args)
}

Expand All @@ -36,7 +36,7 @@ func (s *stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (drive

// Deprecated: Drivers should implement StmtQueryContext instead (or additionally).
func (s *stmt) Query(args []driver.Value) (driver.Rows, error) {
log.DefaultLogger.Debug("Got stmt.Query", s.query)
log.DefaultLogger.Debug("Got stmt.Query", "query", s.query)
return s.c.Query(s.query, args)
}

Expand Down
Loading