Skip to content

Commit

Permalink
don't enable default logger by default
Browse files Browse the repository at this point in the history
  • Loading branch information
lqs committed Jul 23, 2024
1 parent 0ff8886 commit 252be53
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions database.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ func (d *database) SetLogger(loggerFunc LoggerFunc) {
d.logger = loggerFunc
}

// defaultLogger is sqlingo default logger,
// DefaultLogger is sqlingo default logger,
// which print log to stderr and regard executing time gt 100ms as slow sql.
func defaultLogger(sql string, durationNano int64, isTx bool, retry bool) {
func DefaultLogger(sql string, durationNano int64, isTx bool, retry bool) {
// for finding code position, try once is enough
once.Do(func() {
// $GOPATH/pkg/mod/github.com/lqs/[email protected]/database.go
Expand Down Expand Up @@ -173,7 +173,6 @@ func Open(driverName string, dataSourceName string) (db Database, err error) {
}
}
db = Use(driverName, sqlDB)
db.SetLogger(defaultLogger)
return
}

Expand Down

0 comments on commit 252be53

Please sign in to comment.