DEV: Remove autoloading in initializers depreciation message.

This commit is contained in:
Alan Guo Xiang Tan 2021-05-06 10:42:08 +08:00
parent 7a98efe72e
commit c697efc186

View File

@ -19,6 +19,7 @@ if Rails.env.development? && RUBY_VERSION.match?(/^2\.5\.[23]/)
end end
if Rails.env.development? && !Sidekiq.server? && ENV["RAILS_LOGS_STDOUT"] == "1" if Rails.env.development? && !Sidekiq.server? && ENV["RAILS_LOGS_STDOUT"] == "1"
Rails.application.config.after_initialize do
console = ActiveSupport::Logger.new(STDOUT) console = ActiveSupport::Logger.new(STDOUT)
original_logger = Rails.logger.chained.first original_logger = Rails.logger.chained.first
console.formatter = original_logger.formatter console.formatter = original_logger.formatter
@ -27,6 +28,7 @@ if Rails.env.development? && !Sidekiq.server? && ENV["RAILS_LOGS_STDOUT"] == "1"
unless ActiveSupport::Logger.logger_outputs_to?(original_logger, STDOUT) unless ActiveSupport::Logger.logger_outputs_to?(original_logger, STDOUT)
original_logger.extend(ActiveSupport::Logger.broadcast(console)) original_logger.extend(ActiveSupport::Logger.broadcast(console))
end end
end
end end
if Rails.env.production? if Rails.env.production?