Module: RoSupport::Log
- Defined in:
- lib/ro_support/log.rb
Instance Method Summary collapse
Instance Method Details
#raise_log(content, log_file = 'ro.log') ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/ro_support/log.rb', line 4 def raise_log(content, log_file='ro.log') raise err=content if content.is_a?(Exception) if defined?(Rails) && defined?(Rails.root) log = Logger.new("#{Rails.root}/log/#{log_file}") log.error(content) else log = Logger.new(File.join Dir.pwd, log_file) log.error(content) end end |