防护输出窗口将填满以下内容
D, [2012-11-19T18:36:30.391459 #53057] DEBUG -- : (0.1ms) begin transaction
D, [2012-11-19T18:36:30.392668 #53057] DEBUG -- : SQL (0.4ms) INSERT INTO "foo" ("created_at", "id", "foo", "foo", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2012-11-19 18:36:30 -0800], ["id", 4], ["bar", 2], ["foo", 12], ["updated_at", 2012-11-19 18:36:30 -0800], ["value", true]]
D, [2012-11-19T18:36:30.393572 #53057] DEBUG -- : (0.7ms) commit transaction如何关闭此输出?
我尝试过ActiveRecord::Base.logger = nil,但这似乎没有任何作用。
使用sinatra-activerecord、rspec和guard。
发布于 2012-11-20 21:06:17
ActiveRecord::Base.logger.level = 1任何大于或等于1的值都是有效的。我猜它可能也适用于其他数据库。
Reference
https://stackoverflow.com/questions/13465842
复制相似问题