Skip to content

Commit

Permalink
Make verbose logging optional with VERBOSE=true
Browse files Browse the repository at this point in the history
Co-authored-by: Szymon Fiedler <[email protected]>
  • Loading branch information
mostlyobvious and fidel committed Feb 6, 2024
1 parent 1a796c7 commit 055556f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ruby_event_store-active_record/spec/transactions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ module ActiveRecord
around(:each) { |example| helper.run_lifecycle { example.run } }

around(:each) do |example|
previous_logger = ::ActiveRecord::Base.logger
::ActiveRecord::Base.logger =
Logger
.new(STDOUT)
.tap do |l|
l.formatter =
proc { |severity, datetime, progname, msg| "#{msg}\n" }
end
end if ENV.has_key?("VERBOSE")
example.run
::ActiveRecord::Base.logger = nil
ensure
::ActiveRecord::Base.logger = previous_logger
end

specify "no application transaction, event_id conflict" do
Expand Down

0 comments on commit 055556f

Please sign in to comment.