Merge pull request #1126 from rylnd/refactor_logging

Refactor duplicated #log method
This commit is contained in:
Sam 2013-07-01 22:22:45 -07:00
commit 9ef2ad1d66
3 changed files with 8 additions and 16 deletions

View File

@ -18,6 +18,14 @@ module Jobs
class Base
include Sidekiq::Worker
def log(*args)
puts args
args.each do |arg|
Rails.logger.info "#{Time.now.to_formatted_s(:db)}: [#{self.class.name.upcase}] #{arg}"
end
true
end
def self.delayed_perform(opts={})
self.new.perform(opts)
end

View File

@ -106,14 +106,6 @@ module Jobs
true
end
def log(*args)
puts args
args.each do |arg|
Rails.logger.info "#{Time.now.to_formatted_s(:db)}: [EXPORTER] #{arg}"
end
true
end
end
end

View File

@ -276,14 +276,6 @@ module Jobs
@warnings << message
end
def log(*args)
puts args
args.each do |arg|
Rails.logger.info "#{Time.now.to_formatted_s(:db)}: [IMPORTER] #{arg}"
end
true
end
end
end