Last active
August 29, 2015 14:04
-
-
Save pjaspers/aa7d0fbbebdbb78db99e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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