Class: ActiveStorage::LogSubscriber
Overview
Constant Summary
ActiveSupport::EventReporter::LogSubscriber::LEVEL_CHECKS
ActiveSupport::ColorizeLogging::BLACK, ActiveSupport::ColorizeLogging::BLUE, ActiveSupport::ColorizeLogging::CYAN, ActiveSupport::ColorizeLogging::GREEN, ActiveSupport::ColorizeLogging::MAGENTA, ActiveSupport::ColorizeLogging::MODES, ActiveSupport::ColorizeLogging::RED, ActiveSupport::ColorizeLogging::WHITE, ActiveSupport::ColorizeLogging::YELLOW
Class Method Summary
collapse
Instance Method Summary
collapse
#emit, event_log_level, #logger, subscription_filter
#color, #colorize_logging, #error, #fatal, #mode_from, #unknown, #warn
#append_features, #class_methods, extended, #included, #prepend_features, #prepended
Class Method Details
.default_logger ⇒ Object
58
59
60
|
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 58
def self.default_logger
ActiveStorage.logger
end
|
Instance Method Details
#preview(event) ⇒ Object
26
27
28
|
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 26
def preview(event)
info event, color("Previewed file from key: #{key_in(event)}", BLUE)
end
|
#service_delete(event) ⇒ Object
31
32
33
|
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 31
def service_delete(event)
info event, color("Deleted file from key: #{key_in(event)}", RED)
end
|
#service_delete_prefixed(event) ⇒ Object
36
37
38
|
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 36
def service_delete_prefixed(event)
info event, color("Deleted files by key prefix: #{event[:payload][:prefix]}", RED)
end
|
#service_download(event) ⇒ Object
16
17
18
|
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 16
def service_download(event)
info event, color("Downloaded file from key: #{key_in(event)}", BLUE)
end
|
#service_exist(event) ⇒ Object
41
42
43
|
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 41
def service_exist(event)
debug event, color("Checked if file exists at key: #{key_in(event)} (#{event[:payload][:exist] ? "yes" : "no"})", BLUE)
end
|
#service_mirror(event) ⇒ Object
51
52
53
54
55
|
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 51
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
|
#service_streaming_download(event) ⇒ Object
21
22
23
|
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 21
def service_streaming_download(event)
info event, color("Downloaded file from key: #{key_in(event)}", BLUE)
end
|
#service_upload(event) ⇒ Object
9
10
11
12
13
|
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 9
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
|
#service_url(event) ⇒ Object
46
47
48
|
# File 'activestorage/lib/active_storage/log_subscriber.rb', line 46
def service_url(event)
debug event, color("Generated URL for file at key: #{key_in(event)} (#{event[:payload][:url]})", BLUE)
end
|