Skip to content

Commit 2cb29fc

Browse files
committed
Logging in a different way
1 parent 59e7eb5 commit 2cb29fc

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

cfbot_patch.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,8 @@ def process_submission(conn, commitfest_id, submission_id):
400400
# did "patch" actually succeed?
401401
if rcode != 0:
402402
# we failed to apply the patches
403-
logging.info("failed to apply (%s, %s) rcode=%s" % (commitfest_id, submission_id, rcode))
404-
with open("apply_failures.log", "a") as f:
405-
f.write(f"=== Failed to apply submission {submission_id} (commitfest {commitfest_id}) at {time.strftime('%Y-%m-%d %H:%M:%S')} rcode={rcode} ===\n")
406-
f.write(log_content)
407-
f.write("\n")
403+
tail = "\n".join(output.rstrip().split("\n")[-3:])
404+
logging.info("failed to apply (%s, %s) rcode=%s\n%s" % (commitfest_id, submission_id, rcode, tail))
408405
cursor.execute(
409406
"""INSERT INTO branch (commitfest_id, submission_id, status, url, created, modified) VALUES (%s, %s, 'failed', %s, now(), now()) RETURNING id""",
410407
(commitfest_id, submission_id, log_url),

0 commit comments

Comments
 (0)