Skip to content

Commit 6be3ab0

Browse files
committed
Implement its own log method
Refer to rails/rails@da52b0d
1 parent 5d26a8b commit 6be3ab0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/active_record/connection_adapters/oracle_enhanced/dbms_output.rb

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,20 @@ def dbms_output_enabled?
3131
end
3232

3333
private
34-
def log(sql, name = "SQL", binds = [], type_casted_binds = [], statement_name = nil, async: false)
35-
super
34+
def log(sql, name = "SQL", binds = [], type_casted_binds = [], statement_name = nil, async: false, &block)
35+
@instrumenter.instrument(
36+
"sql.active_record",
37+
sql: sql,
38+
name: name,
39+
binds: binds,
40+
type_casted_binds: type_casted_binds,
41+
statement_name: statement_name,
42+
async: async,
43+
connection: self,
44+
&block
45+
)
46+
rescue => e
47+
raise translate_exception_class(e, sql, binds)
3648
ensure
3749
log_dbms_output if dbms_output_enabled?
3850
end

0 commit comments

Comments
 (0)