mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
Improve logging
This commit is contained in:
parent
11fc484270
commit
bbbb3d5367
5 changed files with 8 additions and 17 deletions
|
@ -12,7 +12,7 @@ module Concerns
|
|||
def archivable?(post: false)
|
||||
inactive = inactive?
|
||||
|
||||
log("Found archivable contact id(#{id}), code (#{code})") if inactive && !post
|
||||
puts "Found archivable contact id(#{id}), code (#{code})" if inactive && !post
|
||||
|
||||
inactive
|
||||
end
|
||||
|
@ -38,11 +38,6 @@ module Concerns
|
|||
def inactivity_period
|
||||
Setting.orphans_contacts_in_months.months
|
||||
end
|
||||
|
||||
def log(msg)
|
||||
@logger ||= Logger.new(STDOUT)
|
||||
@logger.info(msg)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,15 +7,9 @@ class InactiveContacts
|
|||
|
||||
def archive(verified: false)
|
||||
contacts.each do |contact|
|
||||
log("Archiving contact: id(#{contact.id}), code(#{contact.code})")
|
||||
|
||||
puts "Archiving contact: id(#{contact.id}), code(#{contact.code})"
|
||||
contact.archive(verified: verified)
|
||||
yield contact if block_given?
|
||||
end
|
||||
end
|
||||
|
||||
def log(msg)
|
||||
@logger ||= Logger.new(STDOUT)
|
||||
@logger.info(msg)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue