Skip to content

Commit

Permalink
Merge pull request #3 from conversation/10950-use-activesupportlogger
Browse files Browse the repository at this point in the history
Use ActiveSupport::Logger
  • Loading branch information
nickbrowne committed Jul 20, 2022
2 parents cccc352 + 824048e commit 4980942
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/split_rails_logs.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require "active_support"
require "fileutils"
require "logger"
require "stringio"

class SplitRailsLogs
Expand All @@ -24,7 +23,7 @@ def self.for_failed(example)
# reusing the io and logger instances each time prevents
# runaway memory usage
@io ||= StringIO.new
@logger ||= Logger.new(@io).tap do |logger|
@logger ||= ActiveSupport::Logger.new(@io).tap do |logger|
Rails.logger.extend(ActiveSupport::Logger.broadcast(logger))
end

Expand Down

0 comments on commit 4980942

Please sign in to comment.