Class: Appium::Core::Logs
- Inherits:
-
Object
- Object
- Appium::Core::Logs
- Defined in:
- lib/appium_lib_core/common/log.rb
Instance Method Summary collapse
-
#available_types ⇒ [Hash]
Get a list of available log types.
-
#event(vendor:, event:) ⇒ nil
Logs a custom event.
- #event=(log_event) ⇒ Object
-
#events(type = nil) ⇒ Hash
Returns events with filtering with ‘type’.
-
#get(type) ⇒ [Selenium::WebDriver::LogEntry]
A list of logs data.
-
#initialize(bridge) ⇒ Logs
constructor
A new instance of Logs.
Constructor Details
#initialize(bridge) ⇒ Logs
Returns a new instance of Logs.
18 19 20 |
# File 'lib/appium_lib_core/common/log.rb', line 18 def initialize(bridge) @bridge = bridge end |
Instance Method Details
#available_types ⇒ [Hash]
Get a list of available log types
41 42 43 |
# File 'lib/appium_lib_core/common/log.rb', line 41 def available_types @bridge.available_log_types end |
#event(vendor:, event:) ⇒ nil
Logs a custom event. The event is available via Events#get.
61 62 63 |
# File 'lib/appium_lib_core/common/log.rb', line 61 def event(vendor:, event:) @bridge.log_event vendor, event end |
#event=(log_event) ⇒ Object
65 66 67 68 69 70 71 72 |
# File 'lib/appium_lib_core/common/log.rb', line 65 def event=(log_event) unless log_event.is_a?(Hash) raise ::Appium::Core::Error::ArgumentError, 'log_event should be Hash like { vendor: "appium", event: "funEvent"}' end event vendor: log_event[:vendor], event: log_event[:event] end |
#events(type = nil) ⇒ Hash
Returns events with filtering with ‘type’. Defaults to all available events.
85 86 87 |
# File 'lib/appium_lib_core/common/log.rb', line 85 def events(type = nil) @bridge.log_events(type) end |
#get(type) ⇒ [Selenium::WebDriver::LogEntry]
Returns A list of logs data.
30 31 32 |
# File 'lib/appium_lib_core/common/log.rb', line 30 def get(type) @bridge.log type end |