Commit c562a8e6 authored by Luke Duncalfe's avatar Luke Duncalfe

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

This reverts merge request !41116
parent ef14a099
---
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 ...@@ -32,19 +32,21 @@ module RspecFlaky
flaky_examples[current_example.uid] = flaky_example flaky_examples[current_example.uid] = flaky_example
end end
# rubocop:disable Gitlab/RailsLogger
def dump_summary(_) def dump_summary(_)
RspecFlaky::Report.new(flaky_examples).write(RspecFlaky::Config.flaky_examples_report_path) RspecFlaky::Report.new(flaky_examples).write(RspecFlaky::Config.flaky_examples_report_path)
# write_report_file(flaky_examples, 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 new_flaky_examples = flaky_examples - suite_flaky_examples
if new_flaky_examples.any? if new_flaky_examples.any?
Gitlab::AppLogger.warn "\nNew flaky examples detected:\n" Rails.logger.warn "\nNew flaky examples detected:\n"
Gitlab::AppLogger.warn Gitlab::Json.pretty_generate(new_flaky_examples.to_h) 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) 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) # write_report_file(new_flaky_examples, RspecFlaky::Config.new_flaky_examples_report_path)
end end
end end
# rubocop:enable Gitlab/RailsLogger
private private
......
...@@ -178,17 +178,19 @@ namespace :gitlab do ...@@ -178,17 +178,19 @@ namespace :gitlab do
end end
end end
# rubocop:disable Gitlab/RailsLogger
def logger def logger
return @logger if defined?(@logger) return @logger if defined?(@logger)
@logger = if Rails.env.development? || Rails.env.production? @logger = if Rails.env.development? || Rails.env.production?
Logger.new(STDOUT).tap do |stdout_logger| 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 stdout_logger.level = debug? ? Logger::DEBUG : Logger::INFO
end end
else else
Gitlab::AppLogger Rails.logger
end end
end end
# rubocop:enable Gitlab/RailsLogger
end end
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