Commit 2f47dabc authored by Thong Kuah's avatar Thong Kuah

Merge branch 'revert-7dc3a5f5' into 'master'

Revert "Merge branch 'app-logger-16' into 'master'"

See merge request gitlab-org/gitlab!41945
parents ef14a099 c562a8e6
---
title: Use AppLogger in listener.rb, cleaner.rake, helpers.rb and spec files
merge_request: 41116
author: Rajendra Kadam
type: other
......@@ -32,19 +32,21 @@ module RspecFlaky
flaky_examples[current_example.uid] = flaky_example
end
# rubocop:disable Gitlab/RailsLogger
def dump_summary(_)
RspecFlaky::Report.new(flaky_examples).write(RspecFlaky::Config.flaky_examples_report_path)
# write_report_file(flaky_examples, RspecFlaky::Config.flaky_examples_report_path)
new_flaky_examples = flaky_examples - suite_flaky_examples
if new_flaky_examples.any?
Gitlab::AppLogger.warn "\nNew flaky examples detected:\n"
Gitlab::AppLogger.warn Gitlab::Json.pretty_generate(new_flaky_examples.to_h)
Rails.logger.warn "\nNew flaky examples detected:\n"
Rails.logger.warn Gitlab::Json.pretty_generate(new_flaky_examples.to_h)
RspecFlaky::Report.new(new_flaky_examples).write(RspecFlaky::Config.new_flaky_examples_report_path)
# write_report_file(new_flaky_examples, RspecFlaky::Config.new_flaky_examples_report_path)
end
end
# rubocop:enable Gitlab/RailsLogger
private
......
......@@ -178,17 +178,19 @@ namespace :gitlab do
end
end
# rubocop:disable Gitlab/RailsLogger
def logger
return @logger if defined?(@logger)
@logger = if Rails.env.development? || Rails.env.production?
Logger.new(STDOUT).tap do |stdout_logger|
stdout_logger.extend(ActiveSupport::Logger.broadcast(Gitlab::AppLogger))
stdout_logger.extend(ActiveSupport::Logger.broadcast(Rails.logger))
stdout_logger.level = debug? ? Logger::DEBUG : Logger::INFO
end
else
Gitlab::AppLogger
Rails.logger
end
end
# rubocop:enable Gitlab/RailsLogger
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