mirror of
https://github.com/discourse/discourse.git
synced 2025-03-24 02:05:33 +08:00
DEV: Log to STDOUT if RAILS_ENABLE_TEST_LOG (#8650)
The env var `RAILS_ENABLE_TEST_LOG` didn't seem to do anything if enabled. This now sets the logger to STDOUT if `RAILS_ENABLE_TEST_LOG` is enabled and also introduces `RAILS_TEST_LOG_LEVEL` so the level of the logging in the console can be provided (default info). Note: I am not sure if the original behaviour is expected. I can add an additional env var to enable the STDOUT logging if required
This commit is contained in:
parent
ec5418fbb4
commit
2050238d0c
@ -47,7 +47,10 @@ Discourse::Application.configure do
|
|||||||
|
|
||||||
config.eager_load = false
|
config.eager_load = false
|
||||||
|
|
||||||
unless ENV['RAILS_ENABLE_TEST_LOG']
|
if ENV['RAILS_ENABLE_TEST_LOG']
|
||||||
|
config.logger = Logger.new(STDOUT)
|
||||||
|
config.log_level = ENV['RAILS_TEST_LOG_LEVEL'].present? ? ENV['RAILS_TEST_LOG_LEVEL'].to_sym : :info
|
||||||
|
else
|
||||||
config.logger = Logger.new(nil)
|
config.logger = Logger.new(nil)
|
||||||
config.log_level = :fatal
|
config.log_level = :fatal
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user