Rename SetQueryLoggerFunc to SetQueryLogger
This commit is contained in:
parent
605f1c8e3d
commit
34f84c7170
7 changed files with 15 additions and 15 deletions
|
|
@ -32,7 +32,7 @@ func callLogger(ctx context.Context, statement Statement) {
|
|||
// QueryInfo contains information about executed query
|
||||
type QueryInfo struct {
|
||||
Statement PrintableStatement
|
||||
// Depending of statement execution method RowsProcessed is:
|
||||
// Depending on how the statement is executed, RowsProcessed is:
|
||||
// - Number of rows returned for Query() and QueryContext() methods
|
||||
// - RowsAffected() for Exec() and ExecContext() methods
|
||||
// - Always 0 for Rows() method.
|
||||
|
|
@ -46,8 +46,8 @@ type QueryLoggerFunc func(ctx context.Context, info QueryInfo)
|
|||
|
||||
var queryLoggerFunc QueryLoggerFunc
|
||||
|
||||
// SetQueryLoggerFunc sets automatic query logging function.
|
||||
func SetQueryLoggerFunc(loggerFunc QueryLoggerFunc) {
|
||||
// SetQueryLogger sets automatic query logging function.
|
||||
func SetQueryLogger(loggerFunc QueryLoggerFunc) {
|
||||
queryLoggerFunc = loggerFunc
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ type OrderByClause = jet.OrderByClause
|
|||
type GroupByClause = jet.GroupByClause
|
||||
|
||||
// SetLogger sets automatic statement logging
|
||||
// Deprecated: use SetQueryLoggerFunc instead.
|
||||
// Deprecated: use SetQueryLogger instead.
|
||||
var SetLogger = jet.SetLoggerFunc
|
||||
|
||||
// SetQueryLoggerFunc sets automatic query logging function.
|
||||
var SetQueryLoggerFunc = jet.SetQueryLoggerFunc
|
||||
// SetQueryLogger sets automatic query logging function.
|
||||
var SetQueryLogger = jet.SetQueryLogger
|
||||
|
||||
// QueryInfo contains information about executed query
|
||||
type QueryInfo = jet.QueryInfo
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ type OrderByClause = jet.OrderByClause
|
|||
type GroupByClause = jet.GroupByClause
|
||||
|
||||
// SetLogger sets automatic statement logging function
|
||||
// Deprecated: use SetQueryLoggerFunc instead.
|
||||
// Deprecated: use SetQueryLogger instead.
|
||||
var SetLogger = jet.SetLoggerFunc
|
||||
|
||||
// SetQueryLoggerFunc sets automatic query logging function.
|
||||
var SetQueryLoggerFunc = jet.SetQueryLoggerFunc
|
||||
// SetQueryLogger sets automatic query logging function.
|
||||
var SetQueryLogger = jet.SetQueryLogger
|
||||
|
||||
// QueryInfo contains information about executed query
|
||||
type QueryInfo = jet.QueryInfo
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ type OrderByClause = jet.OrderByClause
|
|||
type GroupByClause = jet.GroupByClause
|
||||
|
||||
// SetLogger sets automatic statement logging.
|
||||
// Deprecated: use SetQueryLoggerFunc instead.
|
||||
// Deprecated: use SetQueryLogger instead.
|
||||
var SetLogger = jet.SetLoggerFunc
|
||||
|
||||
// SetQueryLoggerFunc sets automatic query logging function.
|
||||
var SetQueryLoggerFunc = jet.SetQueryLoggerFunc
|
||||
// SetQueryLogger sets automatic query logging function.
|
||||
var SetQueryLogger = jet.SetQueryLogger
|
||||
|
||||
// QueryInfo contains information about executed query
|
||||
type QueryInfo = jet.QueryInfo
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ func init() {
|
|||
loggedDebugSQL = statement.DebugSql()
|
||||
})
|
||||
|
||||
jetmysql.SetQueryLoggerFunc(func(ctx context.Context, info jetmysql.QueryInfo) {
|
||||
jetmysql.SetQueryLogger(func(ctx context.Context, info jetmysql.QueryInfo) {
|
||||
queryInfo = info
|
||||
callerFile, callerLine, callerFunction = info.Caller()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ func init() {
|
|||
loggedDebugSQL = statement.DebugSql()
|
||||
})
|
||||
|
||||
postgres.SetQueryLoggerFunc(func(ctx context.Context, info postgres.QueryInfo) {
|
||||
postgres.SetQueryLogger(func(ctx context.Context, info postgres.QueryInfo) {
|
||||
queryInfo = info
|
||||
callerFile, callerLine, callerFunction = info.Caller()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ func init() {
|
|||
loggedDebugSQL = statement.DebugSql()
|
||||
})
|
||||
|
||||
sqlite.SetQueryLoggerFunc(func(ctx context.Context, info sqlite.QueryInfo) {
|
||||
sqlite.SetQueryLogger(func(ctx context.Context, info sqlite.QueryInfo) {
|
||||
queryInfo = info
|
||||
callerFile, callerLine, callerFunction = info.Caller()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue