2017-08-14 11:56:23 +00:00
|
|
|
module Mixin
|
|
|
|
module RailsLogger
|
2017-08-30 14:51:03 +00:00
|
|
|
# add logger method for instance method access
|
2017-08-14 11:56:23 +00:00
|
|
|
extend Forwardable
|
|
|
|
extend SingleForwardable
|
|
|
|
|
|
|
|
instance_delegate [:logger] => self
|
|
|
|
single_delegate [:logger] => :Rails
|
2017-08-30 14:51:03 +00:00
|
|
|
|
|
|
|
# add logger method for class method access
|
|
|
|
def self.included(base)
|
|
|
|
base.extend(SingleForwardable)
|
|
|
|
base.single_delegate [:logger] => :Rails
|
|
|
|
end
|
2017-08-14 11:56:23 +00:00
|
|
|
end
|
|
|
|
end
|