System Wide Console Logging

/ Published in: Ruby
Save to your folder(s)

Add this to your ~/.irbrc file and you will have inline logging in the console

Copy this code and paste it in your HTML
  1. script_console_running = ENV.include?('RAILS_ENV') && IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers')
  2. rails_running = ENV.include?('RAILS_ENV') && !(IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers'))
  3. irb_standalone_running = !script_console_running && !rails_running
  5. if script_console_running
  6. require 'logger'
  7. Object.const_set(:RAILS_DEFAULT_LOGGER,
  8. end


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.