-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't enable default logger by default
- Loading branch information
Showing
1 changed file
with
2 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -173,7 +173,6 @@ func Open(driverName string, dataSourceName string) (db Database, err error) { | |
} | ||
} | ||
db = Use(driverName, sqlDB) | ||
db.SetLogger(defaultLogger) | ||
return | ||
} | ||
|
||
|