Skip to content

Instantly share code, notes, and snippets.

@tomykaira
Last active September 21, 2015 09:00
Show Gist options
  • Save tomykaira/2444b64c0377ee94a151 to your computer and use it in GitHub Desktop.
Save tomykaira/2444b64c0377ee94a151 to your computer and use it in GitHub Desktop.
if Rails.env.development?
class DisableAssetsLogger
def initialize(app)
@app = app
Rails.application.assets.logger = Logger.new('/dev/null')
end
def call(env)
previous_level = Rails.logger.level
Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0
@app.call(env)
ensure
Rails.logger.level = previous_level
end
end
Rails.application.config.middleware.insert_before Rails::Rack::Logger, DisableAssetsLogger
Thread.new do
sleep 1
Rails.application.config.action_mailer.default_url_options.merge!({ protocol: 'https', host: 'lvh.me', port: '8443' })
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment