parameters: (options, resolver)
docstring: Accept stdin stream as source of logs and symbolize it.
docstring_summary: Accept stdin stream as source of logs and symbolize it.
docstring_tokens: Accept stdin stream as source of logs and symbolize it .
function: def substitute_stdin(options, resolver):
      """Accept stdin stream as source of logs and symbolize it."""
  
      # Ignore Ctrl-C. When the process feeding the pipe exits, `stdin` will be closed.
      signal.signal(signal.SIGINT, signal.SIG_IGN)
  
      print("Live mode activated, waiting for input...")
      while True:
          backtrace_indicator = '{"backtrace":'
          line = sys.stdin.readline()
          if not line:
              return
  
          line = line.strip()
  
          if 'Frame: 0x' in line:
              continue
  
          if backtrace_indicator in line:
              backtrace_index = line.index(backtrace_indicator)
              prefix = line[:backtrace_index]
              backtrace = line[backtrace_index:]
              trace_doc = json.loads(backtrace)
              if not trace_doc["backtrace"]:
                  print("Trace is empty, skipping...")
                  continue
              frames = symbolize_frames(trace_doc, resolver, options.symbolizer_path, [],
                                        options.output_format)
              print(prefix)
              print("Symbolizing...")
              classic_output(frames, sys.stdout, indent=2)
          else:
              print(line)
function_tokens: def substitute_stdin ( options , resolver ) : # Ignore Ctrl-C. When the process feeding the pipe exits, `stdin` will be closed. signal . signal ( signal . SIGINT , signal . SIG_IGN ) print ( "Live mode activated, waiting for input..." ) while True : backtrace_indicator = '{"backtrace":' line = sys . stdin . readline ( ) if not line : return line = line . strip ( ) if 'Frame: 0x' in line : continue if backtrace_indicator in line : backtrace_index = line . index ( backtrace_indicator ) prefix = line [ : backtrace_index ] backtrace = line [ backtrace_index : ] trace_doc = json . loads ( backtrace ) if not trace_doc [ "backtrace" ] : print ( "Trace is empty, skipping..." ) continue frames = symbolize_frames ( trace_doc , resolver , options . symbolizer_path , [ ] , options . output_format ) print ( prefix ) print ( "Symbolizing..." ) classic_output ( frames , sys . stdout , indent = 2 ) else : print ( line )