Class: Lockbox::LogSubscriber

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/lockbox/log_subscriber.rb

Instance Method Summary collapse

Instance Method Details

#decrypt_file(event) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/lockbox/log_subscriber.rb', line 12

def decrypt_file(event)
  return unless logger.debug?

  payload = event.payload
  name = "Decrypt File (#{event.duration.round(1)}ms)"

  debug "  #{color(name, YELLOW, bold: true)} Decrypted #{payload[:name]}"
end

#encrypt_file(event) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/lockbox/log_subscriber.rb', line 3

def encrypt_file(event)
  return unless logger.debug?

  payload = event.payload
  name = "Encrypt File (#{event.duration.round(1)}ms)"

  debug "  #{color(name, YELLOW, bold: true)} Encrypted #{payload[:name]}"
end