lib/watir.rb in watir-6.5.0 vs lib/watir.rb in watir-6.6.0

- old
+ new

@@ -9,13 +9,15 @@ require 'watir/adjacent' require 'watir/alert' require 'watir/atoms' require 'watir/container' require 'watir/cookies' +require 'watir/capabilities' require 'watir/browser' require 'watir/screenshot' require 'watir/after_hooks' +require 'watir/logger' module Watir @relaxed_locate = true @@ -41,11 +43,11 @@ always_locate_message true end def always_locate_message - warn <<-EOS + Watir.logger.warn <<-EOS Watir#always_locate is deprecated; elements are always cached and will always be re-located if they go stale before use. Use Element#stale? or Element#wait_until(&:stale?) if needed for flow control. EOS end @@ -58,11 +60,11 @@ prefer_css_message false end def prefer_css_message - warn <<-EOS + Watir.logger.warn <<-EOS Watir#prefer_css is deprecated; all elements that can not be passed directly as Selenium locators will be translated to XPath. To continue using CSS Selectors require the watir_css gem - https://github.com/watir/watir_css EOS end @@ -97,9 +99,19 @@ # def element_class_for(tag_name) tag_to_class[tag_name.to_sym] || HTMLElement end + end + + # + # Returns logger instance that can be used across the whole Selenium. + # + # @return [Logger] + # + + def self.logger + @logger ||= Watir::Logger.new end end require 'watir/attribute_helper'