Module: Rails::Sequel::Logging
- Defined in:
- lib/rails3_sequel/logging.rb
Instance Method Summary collapse
- #log_duration(duration, message) ⇒ Object
- #log_each(level, message) ⇒ Object
- #reset_runtime ⇒ Object
Instance Method Details
#log_duration(duration, message) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/rails3_sequel/logging.rb', line 4 def log_duration (duration, ) @controller_runtime ||= 0 @controller_runtime += duration ActiveSupport::Notifications.instrument('sql.sequel', :sql => , :name => 'SQL', :duration => duration * 1000 ) super end |
#log_each(level, message) ⇒ Object
15 16 17 18 19 |
# File 'lib/rails3_sequel/logging.rb', line 15 def log_each (level, ) # Rails logging is handled by the log subscriber less_rails = @loggers - [Rails.logger] less_rails.each { |logger| logger.send(level, ) } end |
#reset_runtime ⇒ Object
21 22 23 24 |
# File 'lib/rails3_sequel/logging.rb', line 21 def reset_runtime rt, @controller_runtime = @controller_runtime, 0 rt.to_f * 1000 end |