- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何防止 Rails 记录太多?这是我的 production.log 文件中的一个典型跟踪,许多部分,缓存命中......它在开发中很有用,但我不希望在我的生产环境中使用它。
Started GET "/?redirected=true" for 46.193.131.53 at 2012-08-16 18:39:20 +0200
Processing by HomeController#index as HTML
Parameters: {"redirected"=>"true"}
Rendered application/_successfully_connected.html.haml (0.8ms)
Rendered hotspot_infos/_infos.html.haml (0.4ms)
Rendered application/_hotspot_infos.html.haml (1.8ms)
Rendered application/_news.html.haml (0.3ms)
Read fragment views/social-zone-341-directory (0.5ms)
Rendered application/_directory.html.haml (2.5ms)
Rendered application/_meteo.html.haml (1.1ms)
Rendered application/_notifications.html.haml (0.8ms)
Rendered application/_like_button.html.haml (0.3ms)
Rendered application/_navbar.html.haml (4.2ms)
Rendered application/_connection.html.haml (0.5ms)
Rendered application/_gallery.html.haml (0.2ms)
Rendered application/_search_bar.html.haml (0.4ms)
Rendered pictures/_picture_frame.html.haml (0.3ms)
Rendered application/_profile_preview.html.haml (1.4ms)
Rendered application/_profile_block.html.haml (1.7ms)
Rendered application/_menus.html.haml (3.3ms)
Rendered application/_left_pane.html.haml (5.5ms)
Rendered application/_langs.html.haml (0.8ms)
Rendered application/_footer.html.haml (1.9ms)
Rendered application/_flash_modal.html.haml (0.1ms)
Rendered application/_connection_required.js.erb (0.2ms)
Completed 200 OK in 159ms (Views: 25.5ms | ActiveRecord: 88.0ms)
最佳答案
在 Rails 4 中会有一个清理日志的设置:
config.action_view.logger = nil
module ActionView
class LogSubscriber < ActiveSupport::LogSubscriber
def logger
@memoized_logger ||= Logger.new('/dev/null')
end
end
end
关于ruby-on-rails - Rails 日志过于冗长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11991967/
我有一些记录到标准输出的测试,我想根据 nose 运行的冗长程度更改我的测试脚本中的日志级别。 如何从正在运行的测试之一中访问 running nose 实例的详细信息? 最佳答案 这有点 hack,
我们正在尝试序列化一个对象树。虽然我们已经成功了。我希望找到一种方法来简化生成的 xml。 对象看起来像下面这样: public class RuleSet { public IEnumera
查看 git-config 变量和 git-pull 文档,我没有看到默认情况下使 git-pull pull 冗长的方法。有人知道方法吗? 最佳答案 并不是所有的配置参数都适用!但是您可以使用别名自
我有一个小型或中等规模的 F# 项目,15 个 *.fs 文件,大约 2000 行代码。编译突然有点慢,大约5秒。我想找出导致编译速度变慢的原因,但找不到像“详细”这样的 fsc 开关,导致它显示进度
许多 scikit-learn 函数都有一个 verbose 参数,根据他们的文档,“[c]控制详细程度:越高,消息越多”(例如,GridSearchCV)。 很遗憾,没有提供关于允许使用哪些整数(例
我正在尝试以旧方式运行 Rails 测试,即以点作为输出,但我认为我遗漏了一些东西。我找不到在哪里关闭冗长模式,每次我运行 rake 任务时,我都会得到一个测试描述列表,这些描述起初看起来不错,但最终
我是一名优秀的程序员,十分优秀!