Class: ActiveStorage::LogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::Subscriber
- ActiveSupport::LogSubscriber
- ActiveStorage::LogSubscriber
- Defined in:
- activestorage/lib/active_storage/log_subscriber.rb
Constant Summary
Constants inherited from ActiveSupport::LogSubscriber
ActiveSupport::LogSubscriber::BLACK, ActiveSupport::LogSubscriber::BLUE, ActiveSupport::LogSubscriber::BOLD, ActiveSupport::LogSubscriber::CLEAR, ActiveSupport::LogSubscriber::CYAN, ActiveSupport::LogSubscriber::GREEN, ActiveSupport::LogSubscriber::MAGENTA, ActiveSupport::LogSubscriber::RED, ActiveSupport::LogSubscriber::WHITE, ActiveSupport::LogSubscriber::YELLOW
Instance Attribute Summary
Attributes inherited from ActiveSupport::Subscriber
Instance Method Summary collapse
- #logger ⇒ Object
- #service_delete(event) ⇒ Object
- #service_download(event) ⇒ Object
- #service_exist(event) ⇒ Object
- #service_upload(event) ⇒ Object
- #service_url(event) ⇒ Object
Methods inherited from ActiveSupport::LogSubscriber
#finish, flush_all!, log_subscribers, #start
Methods inherited from ActiveSupport::Subscriber
attach_to, #finish, #initialize, method_added, #start, subscribers
Constructor Details
This class inherits a constructor from ActiveSupport::Subscriber
Instance Method Details
#logger ⇒ Object
29 30 31 |
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 29 def logger ActiveStorage::Service.logger end |
#service_delete(event) ⇒ Object
17 18 19 |
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 17 def service_delete(event) info event, color("Deleted file from key: #{key_in(event)}", RED) end |
#service_download(event) ⇒ Object
13 14 15 |
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 13 def service_download(event) info event, color("Downloaded file from key: #{key_in(event)}", BLUE) end |
#service_exist(event) ⇒ Object
21 22 23 |
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 21 def service_exist(event) debug event, color("Checked if file exists at key: #{key_in(event)} (#{event.payload[:exist] ? "yes" : "no"})", BLUE) end |