Method: DEBUGGER__::DAP_TraceInspector::Custom_Session#process_event_record_cmd

Defined in:
lib/debug/dap_custom/traceInspector.rb

#process_event_record_cmd(req, result) ⇒ Object



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/debug/dap_custom/traceInspector.rb', line 254

def process_event_record_cmd(req, result)
  cmd = req.dig('arguments', 'subCommand')
  case cmd
  when 'enable'
    @ui.respond req, {}
  when 'disable'
    @ui.respond req, {}
  when 'collect'
    cnt = result.delete :dropped_trace_cnt
    if cnt > 0
      @ui.puts "Return #{result[:logs].size} traces and #{cnt} traces are dropped"
    else
      @ui.puts "Return #{result[:logs].size} traces"
    end
    @ui.respond req, result
  else
    raise "Unknown command #{cmd}"
  end
end