您可以在跟踪development.log时抑制资产消息吗?
在 Ruby on Rails 应用程序的开发过程中,我通过 tail -f log/development.log
不断跟踪开发日志。
我几周前才开始使用 Rails 进行开发,所以我不知道日志是否总是显示这么多条目,但我相信最近在 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 文件。
我只想在tail
时在我的development.log
中查看所有数据库调用和实际页面调用。
我想知道是否有人知道如何阻止 Rails 记录这些事件,或者是否有 | grep
排除与资产相关的所有内容的方法。
非常感谢帮助,谢谢。
During development of Ruby on Rails applications I have the development log constantly tailing via tail -f log/development.log
.
I have only started developing in Rails a few weeks ago, so I don't know if the log has always shown this many entries, but I believe assets have just recently been added in 3.1. Regardless, this is an exerpt of my development.log
for a page call:
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)
There are actually a few more entried, but I think you got the picture of this taking up a lot of space with all the new lines in between each GET request. I also delete all the unused scss and coffee files that Rails creates when using generate
.
I just want to see all database calls and actual page calls in my development.log
when I tail
it.
I was wondering if anyone knows of a way to stop Rails logging these events, or if there is a | grep
way of excluding everything related to assets.
Help is much appretiated, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的 config/environments/development.rb 中设置
config.assets.debug = false
In your
config/environments/development.rb
setconfig.assets.debug = false