Skip to content

Commit

Permalink
improve log for complete error stack
Browse files Browse the repository at this point in the history
Signed-off-by: ekexium <[email protected]>
  • Loading branch information
ekexium committed May 7, 2022
1 parent 3a99388 commit 8152c55
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions session/nontransactional.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,10 @@ func doOneJob(ctx context.Context, job *job, totalJobCount int, options statemen
err = errors.New("injected split delete error")
})
if err != nil {
errStr := fmt.Sprintf("Non-transactional delete SQL failed, sql: %s, error: %s, jobID: %d, jobSize: %d. ",
deleteSQLInLog, err.Error(), job.jobID, job.jobSize)
logutil.Logger(ctx).Error(errStr)
logutil.Logger(ctx).Error("Non-transactional delete SQL failed", zap.String("job", deleteSQLInLog), zap.Error(err), zap.Int("jobID", job.jobID), zap.Int("jobSize", job.jobSize))
job.err = err
} else {
logutil.Logger(ctx).Debug("Non-transactional delete SQL finished successfully", zap.Int("jobID", job.jobID),
logutil.Logger(ctx).Info("Non-transactional delete SQL finished successfully", zap.Int("jobID", job.jobID),
zap.Int("jobSize", job.jobSize), zap.String("deleteSQL", deleteSQLInLog))
}
if rs != nil {
Expand Down

0 comments on commit 8152c55

Please sign in to comment.