module ActiveRecord::LoggerAttributes

Constants

VERSION

Public Instance Methods

logger_for_logger_attribute(attribute, logger_class) { |l| ... } click to toggle source
# File lib/active_record/logger_attributes.rb, line 26
def logger_for_logger_attribute(attribute, logger_class, &block)
  device = ActiveRecord::LoggerAttributes::Device.new(attribute, self)
  logger_class.new(device).tap do |l|
    progname = [self.class.name]
    progname << id if persisted?
    progname << attribute
    l.progname = progname.join('.') if l.respond_to?(:progname)
    yield l if block_given?
  end
end