Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa/qa.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa.rb')
-rw-r--r--qa/qa.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index cfa2c68a3cd..4ccfa571803 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -101,3 +101,23 @@ Warning.process do |warning|
end
Warning.ignore(/already initialized constant Chemlab::Vendor|previous definition of Vendor was here/)
+
+# TODO: Temporary monkeypatch for broadcast logging
+# Remove once activesupport is upgraded to 7.1
+module Gitlab
+ module QA
+ class TestLogger
+ # Combined logger instance
+ #
+ # @param [<Symbol, String>] level
+ # @param [String] source
+ # @return [ActiveSupport::Logger]
+ def self.logger(level: :info, source: 'Gitlab QA', path: 'tmp')
+ console_log = console_logger(level: level, source: source)
+ file_log = file_logger(source: source, path: path)
+
+ console_log.extend(ActiveSupport::Logger.broadcast(file_log))
+ end
+ end
+ end
+end