Class: AuditLog::LogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- AuditLog::LogSubscriber
- Defined in:
- lib/audit-log/log_subscriber.rb
Instance Method Summary collapse
-
#audit(event) ⇒ Object
ActiveSupport::Notifications.instrument(‘audit.audit_log’, action: action).
Instance Method Details
#audit(event) ⇒ Object
ActiveSupport::Notifications.instrument(‘audit.audit_log’, action: action)
6 7 8 9 10 |
# File 'lib/audit-log/log_subscriber.rb', line 6 def audit(event) prefix = color("AuditLog", CYAN) action = color(event.payload[:action], BLUE) debug " #{prefix} #{action} (#{event.duration.round(1)}ms)" end |