MCPcopy Create free account
hub / github.com/apache/solr / run_with_log_tail

Function run_with_log_tail

dev-tools/scripts/releaseWizard.py:1451–1466  ·  view source on GitHub ↗
(command, cwd, logfile=None, tail_lines=10, tee=False, live=False, shell=None, capture_output=False)

Source from the content-addressed store, hash-verified

1449 print("Tailing last %d lines of file %s" % (lines, file))
1450 print(''.join(data[-lines:]))
1451 break
1452
1453
1454def run_with_log_tail(command, cwd, logfile=None, tail_lines=10, tee=False, live=False, shell=None, capture_output=False):
1455 fh = sys.stdout
1456 if logfile:
1457 logdir = os.path.dirname(logfile)
1458 if not os.path.exists(logdir):
1459 os.makedirs(logdir)
1460 fh = open(logfile, 'w')
1461
1462 rc, captured_output = run_follow(command, cwd, fh=fh, tee=tee, live=live, shell=shell, capture_output=capture_output)
1463
1464 if logfile:
1465 fh.close()
1466 if not tee and tail_lines and tail_lines > 0:
1467 tail_file(logfile, tail_lines)
1468
1469 return rc, captured_output

Callers 1

runMethod · 0.85

Calls 4

run_followFunction · 0.85
tail_fileFunction · 0.85
existsMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…