In newer version of Rails, I'm guessing from 3 up, database queries are output to the console. This is useful most of the time, but how can you hide it when you do not want to see it?
A better way of doing this is by typing this into the console:
ActiveRecord::Base.logger.level = 1
as it prevents problems trying use a pointer to a logger that is set to nil (source: Disable Rails SQL logging in console)
To turn it back on
ActiveRecord::Base.logger.level = 0
ActiveRecord::Base.logger = nil
from here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With