Module: DedicatedLogger::ClassMethods

Defined in:
lib/dedicated_logger.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_dedicated_logger(options = {}) ⇒ Object



15
16
17
18
19
# File 'lib/dedicated_logger.rb', line 15

def acts_as_dedicated_logger options={}
  name = options[:name] || self.name.to_s.underscore
  filepath = options[:filepath] || File.join("log", "#{name}.log")
  @logger = DedicatedLogger::Base.new(name, filepath)
end

#loggerObject



21
22
23
# File 'lib/dedicated_logger.rb', line 21

def logger
  @logger || acts_as_dedicated_logger
end