DEV: Support custom log level in dev

See https://guides.rubyonrails.org/debugging_rails_applications.html#log-levels
Can be used to reduce noise when running "bundle exec rails server" in dev.

Setting DISCOURSE_DEV_LOG_LEVEL="warn" will make for easier puts debugging with unicorn.
This commit is contained in:
Penar Musaraj 2019-12-06 10:57:10 -05:00
parent e51091f199
commit 78969d7719

View File

@ -1,7 +1,6 @@
# frozen_string_literal: true
Discourse::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
@ -38,6 +37,8 @@ Discourse::Application.configure do
config.action_mailer.raise_delivery_errors = true
config.log_level = ENV['DISCOURSE_DEV_LOG_LEVEL'] if ENV['DISCOURSE_DEV_LOG_LEVEL']
BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP']
if defined?(Unicorn) && ENV["UNICORN_WORKERS"].to_i != 1