Class: Nightwing::ClientLogger
- Inherits:
-
Object
- Object
- Nightwing::ClientLogger
- Defined in:
- lib/nightwing/client_logger.rb
Instance Method Summary collapse
-
#initialize(client:, logger:) ⇒ ClientLogger
constructor
A new instance of ClientLogger.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(client:, logger:) ⇒ ClientLogger
Returns a new instance of ClientLogger.
3 4 5 6 |
# File 'lib/nightwing/client_logger.rb', line 3 def initialize(client:, logger:) @client = client @logger = logger end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/nightwing/client_logger.rb', line 8 def method_missing(method, *args, &block) unless @client.respond_to?(method) super end @logger.info "method=#{method} metric=#{args[0]} value=#{args.last if args.size > 1}" @client.public_send(method, *args) end |