Using Webrat mode to determine which logger to use
This commit is contained in:
parent
59560a043b
commit
1fb3fd07d4
@ -1,10 +1,5 @@
|
|||||||
module Webrat
|
module Webrat
|
||||||
module Logging #:nodoc:
|
module Logging #:nodoc:
|
||||||
|
|
||||||
def warn_log(message) # :nodoc:
|
|
||||||
return unless logger
|
|
||||||
logger.warn message
|
|
||||||
end
|
|
||||||
|
|
||||||
def debug_log(message) # :nodoc:
|
def debug_log(message) # :nodoc:
|
||||||
return unless logger
|
return unless logger
|
||||||
@ -12,10 +7,11 @@ module Webrat
|
|||||||
end
|
end
|
||||||
|
|
||||||
def logger # :nodoc:
|
def logger # :nodoc:
|
||||||
if defined? RAILS_DEFAULT_LOGGER
|
case Webrat.configuration.mode
|
||||||
RAILS_DEFAULT_LOGGER
|
when :rails
|
||||||
elsif defined? Merb
|
defined?(RAILS_DEFAULT_LOGGER) ? RAILS_DEFAULT_LOGGER : nil
|
||||||
Merb.logger
|
when :merb
|
||||||
|
Merb.logger
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user