Using Webrat mode to determine which logger to use

This commit is contained in:
Bryan Helmkamp 2008-11-23 14:13:34 -05:00
parent 59560a043b
commit 1fb3fd07d4
1 changed files with 5 additions and 9 deletions

View File

@ -1,10 +1,5 @@
module Webrat
module Logging #:nodoc:
def warn_log(message) # :nodoc:
return unless logger
logger.warn message
end
def debug_log(message) # :nodoc:
return unless logger
@ -12,10 +7,11 @@ module Webrat
end
def logger # :nodoc:
if defined? RAILS_DEFAULT_LOGGER
RAILS_DEFAULT_LOGGER
elsif defined? Merb
Merb.logger
case Webrat.configuration.mode
when :rails
defined?(RAILS_DEFAULT_LOGGER) ? RAILS_DEFAULT_LOGGER : nil
when :merb
Merb.logger
else
nil
end