webrat/lib/webrat/core/logging.rb

25 lines
468 B
Ruby
Raw Normal View History

2008-04-05 16:49:18 +00:00
module Webrat
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:
case Webrat.configuration.mode
2008-12-09 06:12:09 +00:00
when :rails
defined?(RAILS_DEFAULT_LOGGER) ? RAILS_DEFAULT_LOGGER : nil
2008-12-09 06:12:09 +00:00
when :merb
Merb.logger
2008-04-05 16:49:18 +00:00
else
@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