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
|
// QueryInfo contains information about executed query
|
||||||
type QueryInfo struct {
|
type QueryInfo struct {
|
||||||
Statement PrintableStatement
|
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
|
// - Number of rows returned for Query() and QueryContext() methods
|
||||||
// - RowsAffected() for Exec() and ExecContext() methods
|
// - RowsAffected() for Exec() and ExecContext() methods
|
||||||
// - Always 0 for Rows() method.
|
// - Always 0 for Rows() method.
|
||||||
|
|
@ -46,8 +46,8 @@ type QueryLoggerFunc func(ctx context.Context, info QueryInfo)
|
||||||
|
|
||||||
var queryLoggerFunc QueryLoggerFunc
|
var queryLoggerFunc QueryLoggerFunc
|
||||||
|
|
||||||
// SetQueryLoggerFunc sets automatic query logging function.
|
// SetQueryLogger sets automatic query logging function.
|
||||||
func SetQueryLoggerFunc(loggerFunc QueryLoggerFunc) {
|
func SetQueryLogger(loggerFunc QueryLoggerFunc) {
|
||||||
queryLoggerFunc = loggerFunc
|
queryLoggerFunc = loggerFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,11 @@ type OrderByClause = jet.OrderByClause
|
||||||
type GroupByClause = jet.GroupByClause
|
type GroupByClause = jet.GroupByClause
|
||||||
|
|
||||||
// SetLogger sets automatic statement logging
|
// SetLogger sets automatic statement logging
|
||||||
// Deprecated: use SetQueryLoggerFunc instead.
|
// Deprecated: use SetQueryLogger instead.
|
||||||
var SetLogger = jet.SetLoggerFunc
|
var SetLogger = jet.SetLoggerFunc
|
||||||
|
|
||||||
// SetQueryLoggerFunc sets automatic query logging function.
|
// SetQueryLogger sets automatic query logging function.
|
||||||
var SetQueryLoggerFunc = jet.SetQueryLoggerFunc
|
var SetQueryLogger = jet.SetQueryLogger
|
||||||
|
|
||||||
// QueryInfo contains information about executed query
|
// QueryInfo contains information about executed query
|
||||||
type QueryInfo = jet.QueryInfo
|
type QueryInfo = jet.QueryInfo
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,11 @@ type OrderByClause = jet.OrderByClause
|
||||||
type GroupByClause = jet.GroupByClause
|
type GroupByClause = jet.GroupByClause
|
||||||
|
|
||||||
// SetLogger sets automatic statement logging function
|
// SetLogger sets automatic statement logging function
|
||||||
// Deprecated: use SetQueryLoggerFunc instead.
|
// Deprecated: use SetQueryLogger instead.
|
||||||
var SetLogger = jet.SetLoggerFunc
|
var SetLogger = jet.SetLoggerFunc
|
||||||
|
|
||||||
// SetQueryLoggerFunc sets automatic query logging function.
|
// SetQueryLogger sets automatic query logging function.
|
||||||
var SetQueryLoggerFunc = jet.SetQueryLoggerFunc
|
var SetQueryLogger = jet.SetQueryLogger
|
||||||
|
|
||||||
// QueryInfo contains information about executed query
|
// QueryInfo contains information about executed query
|
||||||
type QueryInfo = jet.QueryInfo
|
type QueryInfo = jet.QueryInfo
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,11 @@ type OrderByClause = jet.OrderByClause
|
||||||
type GroupByClause = jet.GroupByClause
|
type GroupByClause = jet.GroupByClause
|
||||||
|
|
||||||
// SetLogger sets automatic statement logging.
|
// SetLogger sets automatic statement logging.
|
||||||
// Deprecated: use SetQueryLoggerFunc instead.
|
// Deprecated: use SetQueryLogger instead.
|
||||||
var SetLogger = jet.SetLoggerFunc
|
var SetLogger = jet.SetLoggerFunc
|
||||||
|
|
||||||
// SetQueryLoggerFunc sets automatic query logging function.
|
// SetQueryLogger sets automatic query logging function.
|
||||||
var SetQueryLoggerFunc = jet.SetQueryLoggerFunc
|
var SetQueryLogger = jet.SetQueryLogger
|
||||||
|
|
||||||
// QueryInfo contains information about executed query
|
// QueryInfo contains information about executed query
|
||||||
type QueryInfo = jet.QueryInfo
|
type QueryInfo = jet.QueryInfo
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ func init() {
|
||||||
loggedDebugSQL = statement.DebugSql()
|
loggedDebugSQL = statement.DebugSql()
|
||||||
})
|
})
|
||||||
|
|
||||||
jetmysql.SetQueryLoggerFunc(func(ctx context.Context, info jetmysql.QueryInfo) {
|
jetmysql.SetQueryLogger(func(ctx context.Context, info jetmysql.QueryInfo) {
|
||||||
queryInfo = info
|
queryInfo = info
|
||||||
callerFile, callerLine, callerFunction = info.Caller()
|
callerFile, callerLine, callerFunction = info.Caller()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ func init() {
|
||||||
loggedDebugSQL = statement.DebugSql()
|
loggedDebugSQL = statement.DebugSql()
|
||||||
})
|
})
|
||||||
|
|
||||||
postgres.SetQueryLoggerFunc(func(ctx context.Context, info postgres.QueryInfo) {
|
postgres.SetQueryLogger(func(ctx context.Context, info postgres.QueryInfo) {
|
||||||
queryInfo = info
|
queryInfo = info
|
||||||
callerFile, callerLine, callerFunction = info.Caller()
|
callerFile, callerLine, callerFunction = info.Caller()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ func init() {
|
||||||
loggedDebugSQL = statement.DebugSql()
|
loggedDebugSQL = statement.DebugSql()
|
||||||
})
|
})
|
||||||
|
|
||||||
sqlite.SetQueryLoggerFunc(func(ctx context.Context, info sqlite.QueryInfo) {
|
sqlite.SetQueryLogger(func(ctx context.Context, info sqlite.QueryInfo) {
|
||||||
queryInfo = info
|
queryInfo = info
|
||||||
callerFile, callerLine, callerFunction = info.Caller()
|
callerFile, callerLine, callerFunction = info.Caller()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue