Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (15 sloc) 442 Bytes
#!/usr/bin/ruby
def change_log(stream)
ActiveRecord::Base.logger = Logger.new(stream)
Object.const_set('RAILS_DEFAULT_LOGGER', ActiveRecord::Base.logger)
ActiveRecord::Base.clear_active_connections!
end
def show_log
change_log(STDOUT)
end
def hide_log
change_log(nil)
end
# Standard console output-logging inexplicably doesn't work for me; turn it on by uncommenting this
# require 'logger'
# Rails.logger = Logger.new(STDOUT)
Something went wrong with that request. Please try again.