Class: Appium::Common::Command::WsLogcat

Inherits:
Appium::Core::WebSocket
  • Object
show all
Defined in:
lib/appium_lib/common/command/ws_logcat.rb

Instance Method Summary collapse

Constructor Details

#initialize(url:, output_file: 'logcat.log') ⇒ WsLogcat

Returns a new instance of WsLogcat.



19
20
21
22
# File 'lib/appium_lib/common/command/ws_logcat.rb', line 19

def initialize(url:, output_file: 'logcat.log')
  super(url: url)
  @output_file = output_file
end

Instance Method Details

#handle_message_data(data) ⇒ Object



24
25
26
# File 'lib/appium_lib/common/command/ws_logcat.rb', line 24

def handle_message_data(data)
  File.open(@output_file, 'a') { |f| f.write("#{data}\n") }
end