Class: ROM::LDAP::RailsLogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- ROM::LDAP::RailsLogSubscriber
- Defined in:
- lib/rom/ldap/extensions/rails_log_subscriber.rb
Instance Method Summary collapse
Instance Method Details
#ldap(event) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rom/ldap/extensions/rails_log_subscriber.rb', line 9 def ldap(event) return unless logger.debug? payload = event.payload name = format('%s (%.1fms)', payload[:name], event.duration) ldap = payload[:ldap].squeeze(' ') binds = payload[:binds].to_a.inspect if payload[:binds] if odd? name = color(name, :cyan, true) ldap = color(ldap, nil, true) else name = color(name, :magenta, true) end debug " #{name} #{ldap} #{binds}" end |
#odd? ⇒ Boolean
30 31 32 |
# File 'lib/rom/ldap/extensions/rails_log_subscriber.rb', line 30 def odd? @odd_or_even = !odd_or_even end |