DEV: Add env var to disable ActiveRecord logging in development (#10979)

If RAILS_DISABLE_ACTIVERECORD_LOGS=1 is passed when starting Rails, none of the query log output will show. This is very useful for debugging with breakpoints because logs are not flooding in constantly.
This commit is contained in:
Martin Brennan 2020-10-21 12:06:12 +10:00 committed by GitHub
parent 516e7e392b
commit 3ae1f98dc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -93,6 +93,10 @@ Discourse::Application.configure do
end
end
if ENV["RAILS_DISABLE_ACTIVERECORD_LOGS"] == "1"
ActiveRecord::Base.logger = nil
end
if ENV['BULLET']
Bullet.enable = true
Bullet.rails_logger = true