Skip to content

Instantly share code, notes, and snippets.

@ches
Created October 17, 2010 07:23
Show Gist options
  • Save ches/630625 to your computer and use it in GitHub Desktop.
Save ches/630625 to your computer and use it in GitHub Desktop.
.irbrc for logging goodies like SQL/Mongo queries to $stdout if in Rails 3 console
# .irbrc to log goodies like SQL/Mongo queries to $stdout if in Rails 3 console
if defined?(Rails) && Rails.respond_to?(:logger)
require 'logger'
Rails.logger = Logger.new($stdout)
if defined?(Mongoid)
Mongoid.logger = Rails.logger
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment