CI: reduce output from helper scripts (#48145)

This commit is contained in:
kwryankrattiger 2024-12-17 13:37:57 -06:00 committed by GitHub
parent f04ea573fa
commit f211e2f9c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,8 @@
import os import os
from llnl.util.tty import tty
def find_logs(prefix, filename): def find_logs(prefix, filename):
for root, _, files in os.walk(prefix): for root, _, files in os.walk(prefix):
@ -37,14 +39,12 @@ def find_logs(prefix, filename):
# Look in the list of prefixes for logs # Look in the list of prefixes for logs
for prefix in prefixes: for prefix in prefixes:
print(f"Walking {prefix}")
logs = [log for log in find_logs(prefix, args.log)] logs = [log for log in find_logs(prefix, args.log)]
print(f" * found {len(logs)} logs")
for log in logs: for log in logs:
print(f" * appending data for {log}") tty.debug(f"appending data for {log}")
with open(log, encoding="utf-8") as fd: with open(log, encoding="utf-8") as fd:
data.append(json.load(fd)) data.append(json.load(fd))
print(f"Writing {args.output_file}") tty.info(f"Writing {len(data)} records to {args.output_file}")
with open(args.output_file, "w", encoding="utf-8") as fd: with open(args.output_file, "w", encoding="utf-8") as fd:
json.dump(data, fd) json.dump(data, fd)