code: def open_telemetry_logs(logpath_telem, logpath_telem_raw):
      '''open log files'''
      if opts.append_log or opts.continue_mode:
          mode = 'a'
      else:
          mode = 'w'
      mpstate.logfile = open(logpath_telem, mode=mode)
      mpstate.logfile_raw = open(logpath_telem_raw, mode=mode)
      print("Log Directory: %s" % mpstate.status.logdir)
      print("Telemetry log: %s" % logpath_telem)
  
      # use a separate thread for writing to the logfile to prevent
      # delays during disk writes (important as delays can be long if camera
      # app is running)
      t = threading.Thread(target=log_writer, name='log_writer')
      t.daemon = True
      t.start(f open_telemetry_logs(logpath_telem, logpath_telem_raw):
      '''open log files'''
      if opts.append_log or opts.continue_mode:
          mode = 'a'
      else:
          mode = 'w'
      mpstate.logfile = open(logpath_telem, mode=mode)
      mpstate.logfile_raw = open(logpath_telem_raw, mode=mode)
      print("Log Directory: %s" % mpstate.status.logdir)
      print("Telemetry log: %s" % logpath_telem)
  
      # use a separate thread for writing to the logfile to prevent
      # delays during disk writes (important as delays can be long if camera
      # app is running)
      t = threading.Thread(target=log_writer, name='log_writer')
      t.daemon = True
      t.start()
docs: open log files