Commit bdd87da0ab13b70173a82a3dc6d7dbbe7de56394
1 parent
14f77607
Exists in
master
and in
2 other branches
Added separate option for logging transport in tests [skip ci]
Showing
1 changed file
with
7 additions
and
4 deletions
Show diff stats
test/test_helper.rb
... | ... | @@ -13,10 +13,13 @@ end |
13 | 13 | |
14 | 14 | $logger = ActiveSupport::Logger.new(ENV["VERBOSE"] ? STDOUT : nil) |
15 | 15 | |
16 | -if Searchkick.client.transport.respond_to?(:transport) | |
17 | - Searchkick.client.transport.transport.logger = $logger | |
18 | -else | |
19 | - Searchkick.client.transport.logger = $logger | |
16 | +if ENV["LOG_TRANSPORT"] | |
17 | + transport_logger = ActiveSupport::Logger.new(STDOUT) | |
18 | + if Searchkick.client.transport.respond_to?(:transport) | |
19 | + Searchkick.client.transport.transport.logger = transport_logger | |
20 | + else | |
21 | + Searchkick.client.transport.logger = transport_logger | |
22 | + end | |
20 | 23 | end |
21 | 24 | Searchkick.search_timeout = 5 |
22 | 25 | Searchkick.index_suffix = ENV["TEST_ENV_NUMBER"] # for parallel tests | ... | ... |