mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 11:27:28 -03:00
test: combine_logs.py - Output debug.log paths on error
This commit is contained in:
parent
bffd92f00f
commit
75bacabb55
1 changed files with 6 additions and 5 deletions
|
@ -79,11 +79,12 @@ def read_logs(tmp_dir):
|
|||
Delegates to generator function get_log_events() to provide individual log events
|
||||
for each of the input log files."""
|
||||
|
||||
# Find out what the folder is called that holds the debug.log file
|
||||
glob = pathlib.Path(tmp_dir).glob('node0/**/debug.log')
|
||||
path = next(glob, None)
|
||||
if path:
|
||||
assert next(glob, None) is None # more than one debug.log, should never happen
|
||||
# Find out what the folder is called that holds node 0's debug.log file
|
||||
debug_logs = list(pathlib.Path(tmp_dir).glob('node0/**/debug.log'))
|
||||
if len(debug_logs) > 0:
|
||||
assert len(debug_logs) < 2, 'Max one debug.log is supported, ' \
|
||||
'found several:\n\t' + '\n\t'.join([str(f) for f in debug_logs])
|
||||
path = debug_logs[0]
|
||||
chain = re.search(r'node0/(.+?)/debug\.log$', path.as_posix()).group(1) # extract the chain name
|
||||
else:
|
||||
chain = 'regtest' # fallback to regtest (should only happen when none exists)
|
||||
|
|
Loading…
Reference in a new issue