diff --git a/internal/jet/logger.go b/internal/jet/logger.go index b883fee..c177d9c 100644 --- a/internal/jet/logger.go +++ b/internal/jet/logger.go @@ -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 } diff --git a/mysql/types.go b/mysql/types.go index 3e15043..6e29b67 100644 --- a/mysql/types.go +++ b/mysql/types.go @@ -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 diff --git a/postgres/types.go b/postgres/types.go index 1e0d7ea..0f3ef70 100644 --- a/postgres/types.go +++ b/postgres/types.go @@ -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 diff --git a/sqlite/types.go b/sqlite/types.go index 91002c2..e06a323 100644 --- a/sqlite/types.go +++ b/sqlite/types.go @@ -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 diff --git a/tests/mysql/main_test.go b/tests/mysql/main_test.go index 75d4ab5..e04580d 100644 --- a/tests/mysql/main_test.go +++ b/tests/mysql/main_test.go @@ -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() }) diff --git a/tests/postgres/main_test.go b/tests/postgres/main_test.go index b4b011b..aa05e0f 100644 --- a/tests/postgres/main_test.go +++ b/tests/postgres/main_test.go @@ -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() }) diff --git a/tests/sqlite/main_test.go b/tests/sqlite/main_test.go index 76d1d58..4eb274e 100644 --- a/tests/sqlite/main_test.go +++ b/tests/sqlite/main_test.go @@ -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() })