rails_logger.rb 399 B

12345678910111213141516
  1. module Mixin
  2. module RailsLogger
  3. # add logger method for instance method access
  4. extend Forwardable
  5. extend SingleForwardable
  6. instance_delegate [:logger] => self
  7. single_delegate [:logger] => :Rails
  8. # add logger method for class method access
  9. def self.included(base)
  10. base.extend(SingleForwardable)
  11. base.single_delegate [:logger] => :Rails
  12. end
  13. end
  14. end