Class: Selenium::WebDriver::Logger
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Logger
- Extended by:
- Forwardable
- Defined in:
- lib/selenium/webdriver/common/logger.rb
Overview
Instance Method Summary collapse
-
#deprecate(old, new = nil) ⇒ Object
Marks code as deprecated with/without replacement.
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
-
#io ⇒ Object
private
Returns IO object used by logger internally.
-
#output=(io) ⇒ Object
Changes logger output to a new IO.
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
48 49 50 |
# File 'lib/selenium/webdriver/common/logger.rb', line 48 def initialize @logger = create_logger($stdout) end |
Instance Method Details
#deprecate(old, new = nil) ⇒ Object
Marks code as deprecated with/without replacement.
82 83 84 85 86 87 88 89 90 91 |
# File 'lib/selenium/webdriver/common/logger.rb', line 82 def deprecate(old, new = nil) = +"[DEPRECATION] #{old} is deprecated" << if new ". Use #{new} instead." else ' and will be removed in the next releases.' end warn end |
#io ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns IO object used by logger internally.
Normally, we would have never needed it, but we want to use it as IO object for all child processes to ensure their output is redirected there.
It is only used in debug level, in other cases output is suppressed.
72 73 74 |
# File 'lib/selenium/webdriver/common/logger.rb', line 72 def io @logger.instance_variable_get(:@logdev).dev end |
#output=(io) ⇒ Object
Changes logger output to a new IO.
57 58 59 |
# File 'lib/selenium/webdriver/common/logger.rb', line 57 def output=(io) @logger.reopen(io) end |