Created
March 19, 2012 11:39
-
-
Save godfat/2108649 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_fork do |server, worker| | |
# dirty hack to shut up Rack::CommonLogger for assets | |
next unless ENV['RACK_ENV'] == 'development' | |
app = server.app | |
app = app.instance_variable_get(:@app) until | |
app.kind_of?(Rack::CommonLogger) || | |
app.instance_variable_get(:@app).nil? | |
app.instance_eval{ | |
@logger.puts "Silencing #{app.class} to #{IO::NULL}..." | |
@logger = File.open(IO::NULL, 'w') | |
} if app && IO.const_defined?(:NULL) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment