File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
- # Copyright (c) 2017-2021 The Bitcoin Core developers
2
+ # Copyright (c) 2017-present The Bitcoin Core developers
3
3
# Distributed under the MIT software license, see the accompanying
4
4
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
5
"""Combine logs from multiple bitcoin nodes as well as the test_framework log.
@@ -81,13 +81,14 @@ def read_logs(tmp_dir):
81
81
82
82
# Find out what the folder is called that holds node 0's debug.log file
83
83
debug_logs = list (pathlib .Path (tmp_dir ).glob ('node0/**/debug.log' ))
84
- if len (debug_logs ) > 0 :
85
- assert len (debug_logs ) < 2 , 'Max one debug.log is supported, ' \
86
- 'found several:\n \t ' + '\n \t ' .join ([str (f ) for f in debug_logs ])
87
- path = debug_logs [0 ]
88
- chain = re .search (r'node0/(.+?)/debug\.log$' , path .as_posix ()).group (1 ) # extract the chain name
89
- else :
90
- chain = 'regtest' # fallback to regtest (should only happen when none exists)
84
+ match len (debug_logs ):
85
+ case 0 :
86
+ chain = 'regtest' # fallback to regtest
87
+ case 1 :
88
+ chain = re .search (r'node0/(.+?)/debug\.log$' , debug_logs [0 ].as_posix ()).group (1 )
89
+ case _:
90
+ raise RuntimeError ('Max one debug.log is supported, found several:\n \t ' +
91
+ '\n \t ' .join (map (str , debug_logs )))
91
92
92
93
files = [("test" , "%s/test_framework.log" % tmp_dir )]
93
94
for i in itertools .count ():
You can’t perform that action at this time.
0 commit comments