Skip to content

Instantly share code, notes, and snippets.

@pjaspers
Last active August 29, 2015 14:04
Show Gist options
  • Save pjaspers/aa7d0fbbebdbb78db99e to your computer and use it in GitHub Desktop.
Save pjaspers/aa7d0fbbebdbb78db99e to your computer and use it in GitHub Desktop.
if defined?(Rails) && Rails.env
begin
require 'hirb'
Hirb.enable
old_print = Pry.config.print
Pry.config.print = proc do |*args|
Hirb::View.view_or_page_output(args[1]) || old_print.call(*args)
end
rescue LoadError
puts "No hirb"
end
module PJ
def log_active_record
ActiveRecord::Base.logger = Logger.new(STDOUT)
end
def log_action_controller
ActionController::Base.logger = Logger.new(STDOUT)
end
def log_rails
Rails.logger = Logger.new(STDOUT)
end
def log_all_the_things
log_action_controller
log_active_record
log_rails
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment