feat(sqlx): error log print traceId and spanId (#2845)

This commit is contained in:
chen quan
2023-02-11 16:12:14 +08:00
committed by GitHub
parent d7d6eccce6
commit ea7dab3d26
3 changed files with 11 additions and 11 deletions

View File

@@ -130,9 +130,9 @@ func format(query string, args ...any) (string, error) {
return b.String(), nil
}
func logInstanceError(datasource string, err error) {
func logInstanceError(ctx context.Context, datasource string, err error) {
datasource = desensitize(datasource)
logx.Errorf("Error on getting sql instance of %s: %v", datasource, err)
logx.WithContext(ctx).Errorf("Error on getting sql instance of %s: %v", datasource, err)
}
func logSqlError(ctx context.Context, stmt string, err error) {