mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 03:33:58 -06:00
Merge pull request #1126 from rylnd/refactor_logging
Refactor duplicated #log method
This commit is contained in:
commit
9ef2ad1d66
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user