Commit 726d598f authored by Rajendra Kadam's avatar Rajendra Kadam

Use AppLogger in lib/gitlab/

This MR adds AppLogger in lib/gitlab
and adds changelog for the change

Add changelog

Fix spec failures and change changelog type

Remove AppLogger from geo logger
parent b8e67cb6
---
title: Use applogger in lib/gitlab/
merge_request: 41052
author: Rajendra Kadam
type: other
...@@ -61,7 +61,7 @@ module Gitlab ...@@ -61,7 +61,7 @@ module Gitlab
# Sentry, instead of silently terminating this thread. # Sentry, instead of silently terminating this thread.
Raven.capture_exception(error) Raven.capture_exception(error)
Rails.logger.error( # rubocop:disable Gitlab/RailsLogger Gitlab::AppLogger.error(
"Service discovery encountered an error: #{error.message}" "Service discovery encountered an error: #{error.message}"
) )
......
...@@ -59,7 +59,7 @@ module Pseudonymizer ...@@ -59,7 +59,7 @@ module Pseudonymizer
pseudonymity_columns) pseudonymity_columns)
) )
rescue => e rescue => e
Rails.logger.error("Failed to export #{table}: #{e}") # rubocop:disable Gitlab/RailsLogger Gitlab::AppLogger.error("Failed to export #{table}: #{e}")
raise e raise e
end end
...@@ -115,7 +115,7 @@ module Pseudonymizer ...@@ -115,7 +115,7 @@ module Pseudonymizer
file_path = output_filename(table) file_path = output_filename(table)
headers = contents.peek.keys 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| Zlib::GzipWriter.open(file_path) do |io|
csv = CSV.new(io, headers: headers, write_headers: true) csv = CSV.new(io, headers: headers, write_headers: true)
contents.each { |row| csv << row.values } contents.each { |row| csv << row.values }
...@@ -123,7 +123,7 @@ module Pseudonymizer ...@@ -123,7 +123,7 @@ module Pseudonymizer
file_path file_path
rescue StopIteration 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 nil
end end
end end
......
...@@ -33,7 +33,7 @@ module Pseudonymizer ...@@ -33,7 +33,7 @@ module Pseudonymizer
pseudo_extra_fields = pseudonymized - whitelisted pseudo_extra_fields = pseudonymized - whitelisted
pseudo_extra_fields.each do |field| 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 end
pseudonymized & whitelisted pseudonymized & whitelisted
......
...@@ -95,7 +95,7 @@ RSpec.describe Pseudonymizer::Dumper do ...@@ -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 pseudo.tables_to_csv
end 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