lib/new_relic/control/frameworks/rails.rb in newrelic_rpm-3.1.0.beta2 vs lib/new_relic/control/frameworks/rails.rb in newrelic_rpm-3.1.0.beta3
- old
+ new
@@ -9,11 +9,15 @@
def env
@env ||= RAILS_ENV.dup
end
def root
- RAILS_ROOT
+ if defined?(RAILS_ROOT) && RAILS_ROOT.to_s != ''
+ RAILS_ROOT.to_s
+ else
+ super
+ end
end
# In versions of Rails prior to 2.0, the rails config was only available to
# the init.rb, so it had to be passed on from there.
def init_config(options={})
@@ -64,15 +68,13 @@
log!("Developer mode not available for Rails versions prior to 2.2", :warn)
end
end
def log!(msg, level=:info)
- return unless should_log?
- begin
- ::RAILS_DEFAULT_LOGGER.send(level, msg)
- rescue Exception => e
- super
- end
+ super unless should_log?
+ ::RAILS_DEFAULT_LOGGER.send(level, msg)
+ rescue Exception => e
+ super
end
def to_stdout(message)
::RAILS_DEFAULT_LOGGER.info(message)
rescue Exception => e