MCPcopy Create free account
hub / github.com/ElementsProject/elements / print_node_warnings

Function print_node_warnings

test/functional/combine_logs.py:102–119  ·  view source on GitHub ↗

Print nodes' errors and warnings

(tmp_dir, colors)

Source from the content-addressed store, hash-verified

100
101
102def print_node_warnings(tmp_dir, colors):
103 """Print nodes' errors and warnings"""
104
105 warnings = []
106 for stream in ['stdout', 'stderr']:
107 for i in itertools.count():
108 folder = "{}/node{}/{}".format(tmp_dir, i, stream)
109 if not os.path.isdir(folder):
110 break
111 for (_, _, fns) in os.walk(folder):
112 for fn in fns:
113 warning = pathlib.Path('{}/{}'.format(folder, fn)).read_text().strip()
114 if warning:
115 warnings.append(("node{} {}".format(i, stream), warning))
116
117 print()
118 for w in warnings:
119 print("{} {} {} {}".format(colors[w[0].split()[0]], w[0], w[1], colors["reset"]))
120
121
122def find_latest_test_dir():

Callers 1

mainFunction · 0.85

Calls 3

countMethod · 0.80
formatMethod · 0.80
walkMethod · 0.80

Tested by

no test coverage detected