Disable Rails SQL logging in console -


is there way disable sql query logging when i'm executing commands in console? ideally, great if can disable , re-enable command in console.

i'm trying debug , using "puts" print out relevant data. however, sql query output making hard read.


edit: found solution, since setting logger nil raised error, if other code tried call logger.warn

instead of setting logger nil can set level of logger 1.

activerecord::base.logger.level = 1 # or logger::info 

to turn off:

old_logger = activerecord::base.logger activerecord::base.logger = nil 

to turn on:

activerecord::base.logger = old_logger 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -