Problem: Running combine_logs.py on the logs from a mainnet functional test such as rpc_validateaddress.py raises AttributeError. The helper expects a path like node0/regtest/debug.log, but mainnet writes node0/debug.log.
Before #16973, the helper silently skipped the mainnet log. That PR made the search recursive, so it finds the log and then fails when the regex tries to extract a subdirectory.
Fix: Get the log directory relative to node0/ from the path the script already found.
<details> <summary>Manual reproducer</summary>
From the repository root with a functional-test build:
dir=$(mktemp -d)
build/test/functional/rpc_validateaddress.py --tmpdir="$dir/run" --nocleanup
test/functional/combine_logs.py "$dir/run"
The address-validation test passes. Before the fix, the last command fails in read_logs():
File "test/functional/combine_logs.py", line 88, in read_logs
chain = re.search(r'node0/(.+?)/debug\.log$', debug_logs[0].as_posix()).group(1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'
With the fix, the same command prints both the test and node0 log entries in timestamp order.
</details>