Using Webrat mode to determine which logger to use
This commit is contained in:
parent
59560a043b
commit
1fb3fd07d4
@ -1,20 +1,16 @@
|
||||
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
|
||||
logger.debug message
|
||||
end
|
||||
|
||||
def logger # :nodoc:
|
||||
if defined? RAILS_DEFAULT_LOGGER
|
||||
RAILS_DEFAULT_LOGGER
|
||||
elsif defined? Merb
|
||||
case Webrat.configuration.mode
|
||||
when :rails
|
||||
defined?(RAILS_DEFAULT_LOGGER) ? RAILS_DEFAULT_LOGGER : nil
|
||||
when :merb
|
||||
Merb.logger
|
||||
else
|
||||
nil
|
||||
|
Loading…
Reference in New Issue
Block a user