Skip to content

Commit

Permalink
Maintenance: Reduce log output by switching log level of serveral pla…
Browse files Browse the repository at this point in the history
…ces.
  • Loading branch information
rolfschmidt authored and thorsteneckel committed May 11, 2021
1 parent 1949bee commit 661989c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/models/active_job_lock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def peform_pending?
end

def transfer_to(active_job)
logger.info "Transferring ActiveJobLock with id '#{id}' from active_job_id '#{active_job_id}' to active_job_id '#{active_job_id}'."
logger.debug { "Transferring ActiveJobLock with id '#{id}' from active_job_id '#{active_job_id}' to active_job_id '#{active_job_id}'." }

reset_time_stamp = Time.zone.now
update!(
Expand Down
1 change: 0 additions & 1 deletion app/models/channel/driver/imap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ def fetch(options, channel, check_type = '', verify_string = '')
raise too_large_messages.join("\n")
end

Rails.logger.info 'done'
{
result: result,
fetched: count_fetched,
Expand Down
2 changes: 1 addition & 1 deletion lib/notification_factory/mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def self.send(data)
raise Exceptions::UnprocessableEntity, "Unable to send mail to user with id #{data[:recipient][:id]} because there is no email available." if data[:recipient][:email].blank?

sender = Setting.get('notification_sender')
Rails.logger.info "Send notification to: #{data[:recipient][:email]} (from:#{sender}/subject:#{data[:subject]})"
Rails.logger.debug { "Send notification to: #{data[:recipient][:email]} (from:#{sender}/subject:#{data[:subject]})" }

content_type = 'text/plain'
if data[:content_type]
Expand Down
6 changes: 3 additions & 3 deletions lib/search_index_backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def self.search_by_index(query, index, options = {})
return [] if !data

data.map do |item|
Rails.logger.info "... #{item['_type']} #{item['_id']}"
Rails.logger.debug { "... #{item['_type']} #{item['_id']}" }

output = {
id: item['_id'],
Expand Down Expand Up @@ -915,7 +915,7 @@ def self.refresh
=end
def self.make_request(url, data: {}, method: :get, open_timeout: 8, read_timeout: 180)
Rails.logger.info "# curl -X #{method} \"#{url}\" "
Rails.logger.debug { "# curl -X #{method} \"#{url}\" " }
Rails.logger.debug { "-d '#{data.to_json}'" } if data.present?

options = {
Expand All @@ -930,7 +930,7 @@ def self.make_request(url, data: {}, method: :get, open_timeout: 8, read_timeout

response = UserAgent.send(method, url, data, options)

Rails.logger.info "# #{response.code}"
Rails.logger.debug { "# #{response.code}" }

response
end
Expand Down

0 comments on commit 661989c

Please sign in to comment.