mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-19 05:45:05 +01:00
test: combine_logs.py - Output debug.log paths on error
This commit is contained in:
parent
bffd92f00f
commit
75bacabb55
@ -79,11 +79,12 @@ def read_logs(tmp_dir):
|
|||||||
Delegates to generator function get_log_events() to provide individual log events
|
Delegates to generator function get_log_events() to provide individual log events
|
||||||
for each of the input log files."""
|
for each of the input log files."""
|
||||||
|
|
||||||
# Find out what the folder is called that holds the debug.log file
|
# Find out what the folder is called that holds node 0's debug.log file
|
||||||
glob = pathlib.Path(tmp_dir).glob('node0/**/debug.log')
|
debug_logs = list(pathlib.Path(tmp_dir).glob('node0/**/debug.log'))
|
||||||
path = next(glob, None)
|
if len(debug_logs) > 0:
|
||||||
if path:
|
assert len(debug_logs) < 2, 'Max one debug.log is supported, ' \
|
||||||
assert next(glob, None) is None # more than one debug.log, should never happen
|
'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
|
chain = re.search(r'node0/(.+?)/debug\.log$', path.as_posix()).group(1) # extract the chain name
|
||||||
else:
|
else:
|
||||||
chain = 'regtest' # fallback to regtest (should only happen when none exists)
|
chain = 'regtest' # fallback to regtest (should only happen when none exists)
|
||||||
|
Loading…
Reference in New Issue
Block a user