rails serverのlogを見やすくする
ずっとログ見てると
Started GET "/assets/twitter/bootstrap.js?body=1" for 127.0.0.1 at 2012-08-15 13:14:05 +0900
Served asset /twitter/bootstrap.js - 304 Not Modified (0ms)
[2012-08-15 13:14:05] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
こういうのが山ほど流れてくるわけで。特にtwitter bootstrapとか入れてると大量なわけで。
でも実際欲しいのはちゃんとLoadとかRenderとかされてるのかなって所なわけで。と言うわけで消えて貰いましょう。
参考:
Could not determine content-length of response body. Set content-length of the response or set Response#chunked = trueとassetのログがウザい件
lib/webrick/httpresponse.rbにパッチを当てる
204_304_keep_alive.patchを参考にパッチをあてます。使用中のruby/libに入ってます。
これで取り敢えず
[2012-08-15 13:14:05] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
は消える。
railsProject内にapp/config/initializers/quiet_assets.rbを作る
3.2 Rails - Rack root tap approach
を頂いて放り込めばおk!logがみやすい!