DEV: Add silencer for verbose query logs in development.

This commit is contained in:
Guo Xiang Tan 2020-06-02 12:15:31 +08:00
parent 3dd1778199
commit 426b62a04a
No known key found for this signature in database
GPG Key ID: FBD110179AAC1F20

View File

@ -82,6 +82,12 @@ Discourse::Application.configure do
config.colorize_logging = true
end
if ENV["RAILS_VERBOSE_QUERY_LOGS"] == "1"
ActiveRecord::LogSubscriber.backtrace_cleaner.add_silencer do |line|
line =~ /lib\/freedom_patches\/fast_pluck\.rb/
end
end
if ENV['BULLET']
Bullet.enable = true
Bullet.rails_logger = true