Commit d72cfb31 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'app-logger-6' into 'master'

Use AppLogger in lib/gitlab/

See merge request gitlab-org/gitlab!41052
parents aa96300a 726d598f
---
title: Use applogger in lib/gitlab/
merge_request: 41052
author: Rajendra Kadam
type: other
......@@ -61,7 +61,7 @@ module Gitlab
# Sentry, instead of silently terminating this thread.
Raven.capture_exception(error)
Rails.logger.error( # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.error(
"Service discovery encountered an error: #{error.message}"
)
......
......@@ -59,7 +59,7 @@ module Pseudonymizer
pseudonymity_columns)
)
rescue => e
Rails.logger.error("Failed to export #{table}: #{e}") # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.error("Failed to export #{table}: #{e}")
raise e
end
......@@ -115,7 +115,7 @@ module Pseudonymizer
file_path = output_filename(table)
headers = contents.peek.keys
Rails.logger.info "#{self.class.name} writing #{table} to #{file_path}." # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.info "#{self.class.name} writing #{table} to #{file_path}."
Zlib::GzipWriter.open(file_path) do |io|
csv = CSV.new(io, headers: headers, write_headers: true)
contents.each { |row| csv << row.values }
......@@ -123,7 +123,7 @@ module Pseudonymizer
file_path
rescue StopIteration
Rails.logger.info "#{self.class.name} table #{table} is empty." # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.info "#{self.class.name} table #{table} is empty."
nil
end
end
......
......@@ -33,7 +33,7 @@ module Pseudonymizer
pseudo_extra_fields = pseudonymized - whitelisted
pseudo_extra_fields.each do |field|
Rails.logger.warn("#{self.class.name} extraneous pseudo: #{@table}.#{field} is not whitelisted and will be ignored.") # rubocop:disable Gitlab/RailsLogger
Gitlab::AppLogger.warn("#{self.class.name} extraneous pseudo: #{@table}.#{field} is not whitelisted and will be ignored.")
end
pseudonymized & whitelisted
......
......@@ -95,7 +95,7 @@ RSpec.describe Pseudonymizer::Dumper do
}
}
expect(Rails.logger).to receive(:warn).with(/extraneous/)
expect(Gitlab::AppLogger).to receive(:warn).with(/extraneous/)
pseudo.tables_to_csv
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment