Skip to content

Commit

Permalink
change sql log field name time to elapsed
Browse files Browse the repository at this point in the history
  • Loading branch information
wen-templari committed Feb 15, 2024
1 parent 5d19cbd commit 9fb8d2e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion repo/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package repo
import (
"context"
"database/sql"
"log"
"os"
"time"
"unsafe"

"github.com/go-sql-driver/mysql"
"github.com/nbtca/saturday/util"
Expand All @@ -30,7 +32,7 @@ func (h *Hooks) After(ctx context.Context, query string, args ...interface{}) (c
util.Logger.WithFields(logrus.Fields{
"query": query,
"args": args,
"time": time.Since(begin),
"elapsed": time.Since(begin),
}).Debug("SQL executed")
return ctx, nil
}
Expand Down

0 comments on commit 9fb8d2e

Please sign in to comment.