在 Ruby on Rails 应用程序的开发过程中,我的开发日志通过 tail -f log/development.log
不断拖尾。 .
我几周前才开始在 Rails 中进行开发,所以我不知道日志是否总是显示这么多条目,但我相信 Assets 是最近在 3.1 中添加的。无论如何,这是我的 development.log
的摘录对于页面调用:
Started GET "/assets/reset.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /reset.css - 304 Not Modified (1ms)
Started GET "/assets/style.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /style.css - 304 Not Modified (0ms)
Started GET "/assets/application.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Started asset /application.css - 304 Not Modified (0ms)
Started GET "/assets/application.js?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /application.js - 200 OK (1ms)
实际上还有一些条目,但我认为您已经看到了每个 GET 请求之间的所有新行占用大量空间的图片。我还删除了 Rails 在使用
generate
时创建的所有未使用的 scss 和 coffee 文件。 .我只想在我的
development.log
中查看所有数据库调用和实际页面调用当我tail
它。我想知道是否有人知道阻止 Rails 记录这些事件的方法,或者是否有
| grep
排除与 Assets 相关的所有内容的方法。非常感谢帮助,谢谢。
最佳答案
在您的 config/environments/development.rb
放config.assets.debug = false
关于ruby-on-rails - 拖尾 development.log 时可以抑制 Assets 消息吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7753962/