method
log
log(sql, name)
protected
Hide source
# File activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 69 def log(sql, name) if block_given? if @logger and @logger.level <= Logger::INFO result = nil seconds = Benchmark.realtime { result = yield } @runtime += seconds log_info(sql, name, seconds) result else yield end else log_info(sql, name, 0) nil end rescue Exception => e # Log message and raise exception. message = "#{e.class.name}: #{e.message}: #{sql}" log_info(message, name, 0) raise ActiveRecord::StatementInvalid, message end