rails_logger.rb 476 B

123456789101112131415161718
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Mixin
  3. module RailsLogger
  4. # add logger method for instance method access
  5. extend Forwardable
  6. extend SingleForwardable
  7. instance_delegate [:logger] => self
  8. single_delegate [:logger] => :Rails
  9. # add logger method for class method access
  10. def self.included(base)
  11. base.extend(SingleForwardable)
  12. base.single_delegate [:logger] => :Rails
  13. end
  14. end
  15. end