diff options
author | Prem Sichanugrist <s@sikachu.com> | 2010-02-15 21:44:30 +0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-16 22:36:15 +0100 |
commit | f0523f72b46db14e2f50c8347a8708734c650f84 (patch) | |
tree | cf6562eb8f6c2e302a33840f36f04d838aadb569 /activeresource/lib/active_resource/railties/log_subscriber.rb | |
parent | 7cff54f5d3ae2e364f0d147ceb86ea701b21389c (diff) | |
download | rails-f0523f72b46db14e2f50c8347a8708734c650f84.tar.gz rails-f0523f72b46db14e2f50c8347a8708734c650f84.tar.bz2 rails-f0523f72b46db14e2f50c8347a8708734c650f84.zip |
Rename Rails::Subscriber to Rails::LogSubscriber
Diffstat (limited to 'activeresource/lib/active_resource/railties/log_subscriber.rb')
-rw-r--r-- | activeresource/lib/active_resource/railties/log_subscriber.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activeresource/lib/active_resource/railties/log_subscriber.rb b/activeresource/lib/active_resource/railties/log_subscriber.rb new file mode 100644 index 0000000000..86806a93d0 --- /dev/null +++ b/activeresource/lib/active_resource/railties/log_subscriber.rb @@ -0,0 +1,15 @@ +module ActiveResource + module Railties + class LogSubscriber < Rails::LogSubscriber + def request(event) + result = event.payload[:result] + info "#{event.payload[:method].to_s.upcase} #{event.payload[:request_uri]}" + info "--> %d %s %d (%.1fms)" % [result.code, result.message, result.body.to_s.length, event.duration] + end + + def logger + ActiveResource::Base.logger + end + end + end +end
\ No newline at end of file |