Commit 0f06648f authored by Alex Kalderimis's avatar Alex Kalderimis

Ensure we prefix each line when logging the SQL

This improves the debug log experience, by ensuring that all multi-line
SQL queries are greppable easily.
parent 31cd90fb
......@@ -18,7 +18,9 @@ module ActiveRecord
end
def show_backtrace(values)
Rails.logger.debug("QueryRecorder SQL: #{values[:sql]}")
values[:sql].lines.each do |line|
Rails.logger.debug("QueryRecorder SQL: --> #{line}")
end
Gitlab::BacktraceCleaner.clean_backtrace(caller).each do |line|
Rails.logger.debug("QueryRecorder backtrace: --> #{line}")
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment