class ActiveStorage::LogSubscriber
Inherits From
Public instance methods
Source code GitHub
# File activestorage/lib/active_storage/log_subscriber.rb, line 53
def logger
ActiveStorage.logger
end
Source code GitHub
# File activestorage/lib/active_storage/log_subscriber.rb, line 21
def preview(event)
info event, color("Previewed file from key: #{key_in(event)}", BLUE)
end
Source code GitHub
# File activestorage/lib/active_storage/log_subscriber.rb, line 26
def service_delete(event)
info event, color("Deleted file from key: #{key_in(event)}", RED)
end
Source code GitHub
# File activestorage/lib/active_storage/log_subscriber.rb, line 31
def service_delete_prefixed(event)
info event, color("Deleted files by key prefix: #{event.payload[:prefix]}", RED)
end
Also aliased as:
service_streaming_download
.
Source code GitHub
# File activestorage/lib/active_storage/log_subscriber.rb, line 14
def service_download(event)
info event, color("Downloaded file from key: #{key_in(event)}", BLUE)
end
Source code GitHub
# File activestorage/lib/active_storage/log_subscriber.rb, line 36
def service_exist(event)
debug event, color("Checked if file exists at key: #{key_in(event)} (#{event.payload[:exist] ? "yes" : "no"})", BLUE)
end
Source code GitHub
# File activestorage/lib/active_storage/log_subscriber.rb, line 46
def service_mirror(event)
message = "Mirrored file at key: #{key_in(event)}"
message += " (checksum: #{event.payload[:checksum]})" if event.payload[:checksum]
debug event, color(message, GREEN)
end
Alias for:
service_download
.
Source code GitHub
# File activestorage/lib/active_storage/log_subscriber.rb, line 7
def service_upload(event)
message = "Uploaded file to key: #{key_in(event)}"
message += " (checksum: #{event.payload[:checksum]})" if event.payload[:checksum]
info event, color(message, GREEN)
end
Source code GitHub
# File activestorage/lib/active_storage/log_subscriber.rb, line 41
def service_url(event)
debug event, color("Generated URL for file at key: #{key_in(event)} (#{event.payload[:url]})", BLUE)
end