Commit 69882367 authored by Peter Leitzen's avatar Peter Leitzen

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

Use applogger in some files of ee/lib/* and spec files

See merge request gitlab-org/gitlab!41056
parents d6c9e1a5 da930a50
---
title: Use applogger in some files of ee/lib/* and spec files
merge_request: 41056
author: Rajendra Kadam
type: other
...@@ -532,7 +532,7 @@ module API ...@@ -532,7 +532,7 @@ module API
::Gitlab::Tracking.event(category, action.to_s, **args) ::Gitlab::Tracking.event(category, action.to_s, **args)
rescue => error rescue => error
Rails.logger.warn( # rubocop:disable Gitlab/RailsLogger Gitlab::AppLogger.warn(
"Tracking event failed for action: #{action}, category: #{category}, message: #{error.message}" "Tracking event failed for action: #{action}, category: #{category}, message: #{error.message}"
) )
end end
......
...@@ -67,7 +67,7 @@ module API ...@@ -67,7 +67,7 @@ module API
result == 'PONG' result == 'PONG'
rescue => e rescue => e
Rails.logger.warn("GitLab: An unexpected error occurred in pinging to Redis: #{e}") # rubocop:disable Gitlab/RailsLogger Gitlab::AppLogger.warn("GitLab: An unexpected error occurred in pinging to Redis: #{e}")
false false
end end
......
...@@ -183,7 +183,7 @@ RSpec.describe API::Helpers do ...@@ -183,7 +183,7 @@ RSpec.describe API::Helpers do
end end
it "logs an exception" do it "logs an exception" do
expect(Rails.logger).to receive(:warn).with(/Tracking event failed/) expect(Gitlab::AppLogger).to receive(:warn).with(/Tracking event failed/)
subject.track_event('my_event', category: nil) subject.track_event('my_event', category: nil)
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