From 252be5342f9ee896e9a39cb538bd16f14a69b073 Mon Sep 17 00:00:00 2001 From: Qishuai Liu Date: Tue, 23 Jul 2024 23:33:42 +0900 Subject: [PATCH] don't enable default logger by default --- database.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/database.go b/database.go index 54e3a41..31a3b97 100644 --- a/database.go +++ b/database.go @@ -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/sqlingo@vX.X.X/database.go @@ -173,7 +173,6 @@ func Open(driverName string, dataSourceName string) (db Database, err error) { } } db = Use(driverName, sqlDB) - db.SetLogger(defaultLogger) return }