Class: IIPolicy::LogSubscriber

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

Instance Method Summary collapse

Instance Method Details

#process_call(event) ⇒ Object



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

def process_call(event)
  debug do
    policy = event.payload[:policy]
    action = event.payload[:action]
    "  Called #{policy.class}##{action} and return #{policy._result} (#{additional_log(event)})"
  end
end

#start_call_all(event) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/ii_policy/log_subscriber.rb', line 5

def start_call_all(event)
  debug do
    policy = event.payload[:policy]
    action = event.payload[:action]
    "  Calling #{policy.class}##{action} with #{policy.context}"
  end
end