Permalink
Browse files

Remove Watir.log method. Use standard Ruby Logger instead.

  • Loading branch information...
1 parent d5d0c18 commit 731f1b0cff5199d563760e1fa5015eae6e2cf413 @jarmo jarmo committed Aug 19, 2012
View
5 lib/watir-classic/container.rb
@@ -38,11 +38,6 @@ def copy_test_config(container) # only used by form and frame
end
private :copy_test_config
- # Write the specified string to the log.
- def log(what)
- @container.logger.debug(what) if @logger
- end
-
# Wait until Browser has finished loading the page.
#--
# called explicitly by most click and set methods
View
5 lib/watir-classic/core.rb
@@ -11,8 +11,6 @@
require 'watir-classic/wait_helper'
require 'watir-classic/element_extensions'
-require 'logger'
-require 'watir-classic/logger'
require 'watir-classic/container'
require 'watir-classic/xpath_locator'
require 'watir-classic/locator'
@@ -30,7 +28,6 @@
require 'watir-classic/link'
require 'watir-classic/window'
require 'watir-classic/cookies'
-require 'watir-classic/dialogs/alert'
require 'watir-classic/win32'
require 'watir-classic/modal_dialog'
@@ -39,6 +36,6 @@
require 'rautomation'
require 'watir-classic/dialogs/file_field'
-require 'watir-classic/dialogs/javascript'
+require 'watir-classic/dialogs/alert'
require 'watir-classic/supported_elements'
View
19 lib/watir-classic/ie-class.rb
@@ -74,8 +74,6 @@ def self.base_index
# the OLE Internet Explorer object
attr_accessor :ie
- # access to the logger object
- attr_accessor :logger
# this contains the list of unique urls that have been visited
attr_reader :url_list
@@ -176,9 +174,6 @@ def initialize_options
@page_container = self
@error_checkers = []
@activeObjectHighLightColor = HIGHLIGHT_COLOR
-
-
- @logger = DefaultLogger.new
@url_list = []
end
@@ -342,15 +337,6 @@ def exists?
end
alias :exist? :exists?
- # deprecated: use logger= instead
- def set_logger(logger)
- @logger = logger
- end
-
- def log(what)
- @logger.debug(what) if @logger
- end
-
#
# Accessing data outside the document
#
@@ -758,13 +744,12 @@ def create_browser_window
end
def attach_browser_window how, what
- log "Seeking Window with #{how}: #{what}"
ieTemp = nil
begin
- Watir::until_with_timeout do
+ Wait.until(IE.attach_timeout) do
ieTemp = IE._find how, what
end
- rescue Watir::Wait::TimeoutError
+ rescue Wait::TimeoutError
raise NoMatchingWindowFoundException,
"Unable to locate a window with #{how} of #{what}"
end
View
1 lib/watir-classic/input_elements.rb
@@ -363,7 +363,6 @@ def limit_to_maxlength(value)
return value if @o.invoke('type') =~ /textarea/i # text areas don't have maxlength
if value.length > maxlength
value = value[0 .. maxlength - 1]
- @container.log " Supplied string is #{value.length} chars, which exceeds the max length (#{maxlength}) of the field. Using value: #{value}"
end
value
end
View
19 lib/watir-classic/logger.rb
@@ -1,19 +0,0 @@
-module Watir
- class WatirLogger < Logger
- def initialize(filName, logsToKeep, maxLogSize)
- super(filName, logsToKeep, maxLogSize)
- self.level = Logger::DEBUG
- self.datetime_format = "%d-%b-%Y %H:%M:%S"
- self.debug("Watir starting")
- end
- end
-
- class DefaultLogger < Logger
- def initialize
- super(STDERR)
- self.level = Logger::WARN
- self.datetime_format = "%d-%b-%Y %H:%M:%S"
- self.info "Log started"
- end
- end
-end

0 comments on commit 731f1b0

Please sign in to comment.