Commit 7dc3a5f5 authored by Peter Leitzen's avatar Peter Leitzen

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

Use AppLogger in listener.rb, cleaner.rake, helpers.rb and spec files

See merge request gitlab-org/gitlab!41116
parents 028bfb11 565bef3b
---
title: Use AppLogger in listener.rb, cleaner.rake, helpers.rb and spec files
merge_request: 41116
author: Rajendra Kadam
type: other
......@@ -32,21 +32,19 @@ 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?
Rails.logger.warn "\nNew flaky examples detected:\n"
Rails.logger.warn Gitlab::Json.pretty_generate(new_flaky_examples.to_h)
Gitlab::AppLogger.warn "\nNew flaky examples detected:\n"
Gitlab::AppLogger.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,19 +178,17 @@ 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(Rails.logger))
stdout_logger.extend(ActiveSupport::Logger.broadcast(Gitlab::AppLogger))
stdout_logger.level = debug? ? Logger::DEBUG : Logger::INFO
end
else
Rails.logger
Gitlab::AppLogger
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