diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-24 18:08:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-24 18:08:04 +0300 |
commit | 937b3143d4da152dedb0ccd8b6a956b852288788 (patch) | |
tree | 0a14eee2f242fb0a58edde88e8841e3db08fa05c /app | |
parent | 735e7717e7656cd449affd989fc16f2228f7dd00 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/models/chat_team.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 16 | ||||
-rw-r--r-- | app/models/project_import_state.rb | 2 |
3 files changed, 7 insertions, 13 deletions
diff --git a/app/models/chat_team.rb b/app/models/chat_team.rb index 28aab279545..6e39d7e2204 100644 --- a/app/models/chat_team.rb +++ b/app/models/chat_team.rb @@ -12,6 +12,6 @@ class ChatTeam < ApplicationRecord # Either the group is not found, or the user doesn't have the proper # access on the mattermost instance. In the first case, we're done either way # in the latter case, we can't recover by retrying, so we just log what happened - Rails.logger.error("Mattermost team deletion failed: #{e}") # rubocop:disable Gitlab/RailsLogger + Gitlab::AppLogger.error("Mattermost team deletion failed: #{e}") end end diff --git a/app/models/project.rb b/app/models/project.rb index c657e76c86f..314f24f3f6d 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -925,17 +925,15 @@ class Project < ApplicationRecord job_id end - # rubocop:disable Gitlab/RailsLogger def log_import_activity(job_id, type: :import) job_type = type.to_s.capitalize if job_id - Rails.logger.info("#{job_type} job scheduled for #{full_path} with job ID #{job_id}.") + Gitlab::AppLogger.info("#{job_type} job scheduled for #{full_path} with job ID #{job_id}.") else - Rails.logger.error("#{job_type} job failed to create for #{full_path}.") + Gitlab::AppLogger.error("#{job_type} job failed to create for #{full_path}.") end end - # rubocop:enable Gitlab/RailsLogger def reset_cache_and_import_attrs run_after_commit do @@ -1776,17 +1774,15 @@ class Project < ApplicationRecord ensure_pages_metadatum.update!(deployed: false) end - # rubocop:disable Gitlab/RailsLogger def write_repository_config(gl_full_path: full_path) # We'd need to keep track of project full path otherwise directory tree # created with hashed storage enabled cannot be usefully imported using # the import rake task. repository.raw_repository.write_config(full_path: gl_full_path) rescue Gitlab::Git::Repository::NoRepository => e - Rails.logger.error("Error writing to .git/config for project #{full_path} (#{id}): #{e.message}.") + Gitlab::AppLogger.error("Error writing to .git/config for project #{full_path} (#{id}): #{e.message}.") nil end - # rubocop:enable Gitlab/RailsLogger def after_import repository.expire_content_cache @@ -1829,17 +1825,15 @@ class Project < ApplicationRecord @pipeline_status ||= Gitlab::Cache::Ci::ProjectPipelineStatus.load_for_project(self) end - # rubocop:disable Gitlab/RailsLogger def add_export_job(current_user:, after_export_strategy: nil, params: {}) job_id = ProjectExportWorker.perform_async(current_user.id, self.id, after_export_strategy, params) if job_id - Rails.logger.info "Export job started for project ID #{self.id} with job ID #{job_id}" + Gitlab::AppLogger.info "Export job started for project ID #{self.id} with job ID #{job_id}" else - Rails.logger.error "Export job failed to start for project ID #{self.id}" + Gitlab::AppLogger.error "Export job failed to start for project ID #{self.id}" end end - # rubocop:enable Gitlab/RailsLogger def import_export_shared @import_export_shared ||= Gitlab::ImportExport::Shared.new(self) diff --git a/app/models/project_import_state.rb b/app/models/project_import_state.rb index e434ea58729..dfe660ac780 100644 --- a/app/models/project_import_state.rb +++ b/app/models/project_import_state.rb @@ -84,7 +84,7 @@ class ProjectImportState < ApplicationRecord update_column(:last_error, sanitized_message) rescue ActiveRecord::ActiveRecordError => e - Rails.logger.error("Error setting import status to failed: #{e.message}. Original error: #{sanitized_message}") # rubocop:disable Gitlab/RailsLogger + Gitlab::AppLogger.error("Error setting import status to failed: #{e.message}. Original error: #{sanitized_message}") ensure @errors = original_errors end |