def open_telemetry_logs(logpath_telem, logpath_telem_raw):
 if (opts.append_log or opts.continue_mode):
  mode = 'a'
 else:
  mode = 'w'
 try:
  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)
  if (platform.system() != 'Windows'):
   stat = os.statvfs(logpath_telem)
   if ((stat.f_bfree * stat.f_bsize) < 209715200):
    print 'ERROR: Not enough free disk space for logfile'
    mpstate.status.exit = True
    return
  t = threading.Thread(target=log_writer, name='log_writer')
  t.daemon = True
  t.start()
 except Exception as e:
  print ('ERROR: opening log file for writing: %s' % e)
  mpstate.status.exit = True
  return

def open_telemetry_logs ( logpath_telem , logpath_telem_raw ) : if ( opts . append_log or opts . continue_mode ) : mode = 'a' else : mode = 'w' try : 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 ) if ( platform . system ( ) != 'Windows' ) : stat = os . statvfs ( logpath_telem ) if ( ( stat . f_bfree * stat . f_bsize ) < 209715200 ) : print 'ERROR: Not enough free disk space for logfile' mpstate . status . exit = True return t = threading . Thread ( target = log_writer , name = 'log_writer' ) t . daemon = True t . start ( ) except Exception as e : print ( 'ERROR: opening log file for writing: %s' % e ) mpstate . status . exit = True return
open log files .