2008-04-05 16:49:18 +00:00
|
|
|
module Webrat
|
2008-11-07 17:13:41 +00:00
|
|
|
module Logging #:nodoc:
|
2009-04-08 00:30:12 +00:00
|
|
|
|
2008-04-05 16:49:18 +00:00
|
|
|
def debug_log(message) # :nodoc:
|
|
|
|
return unless logger
|
2008-04-16 09:54:37 +00:00
|
|
|
logger.debug message
|
2008-04-05 16:49:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def logger # :nodoc:
|
2008-11-23 19:13:34 +00:00
|
|
|
case Webrat.configuration.mode
|
2008-12-09 06:12:09 +00:00
|
|
|
when :rails
|
2008-11-23 19:13:34 +00:00
|
|
|
defined?(RAILS_DEFAULT_LOGGER) ? RAILS_DEFAULT_LOGGER : nil
|
2008-12-09 06:12:09 +00:00
|
|
|
when :merb
|
2008-11-23 19:13:34 +00:00
|
|
|
Merb.logger
|
2008-04-05 16:49:18 +00:00
|
|
|
else
|
2009-05-11 04:11:01 +00:00
|
|
|
@logger ||= begin
|
|
|
|
require "logger"
|
|
|
|
::Logger.new("webrat.log")
|
|
|
|
end
|
2008-04-05 16:49:18 +00:00
|
|
|
end
|
|
|
|
end
|
2009-04-08 00:30:12 +00:00
|
|
|
|
2008-04-05 16:49:18 +00:00
|
|
|
end
|
2009-04-08 00:30:12 +00:00
|
|
|
end
|