Skip to content

Commit fa8a261

Browse files
even better logging
1 parent c13cd67 commit fa8a261

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cog_safe_push/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ async def run_with_semaphore(task: Task) -> None:
460460
# Get prediction index if the task has one
461461
prediction_index = getattr(task, "prediction_index", None)
462462
errors.append((e, prediction_index))
463+
prefix = "" if prediction_index is None else f"[{prediction_index}] "
464+
log.error(f"{prefix}{error}")
463465

464466
# Create task coroutines and run them concurrently
465467
task_coroutines = [run_with_semaphore(task) for task in tasks]
@@ -469,10 +471,10 @@ async def run_with_semaphore(task: Task) -> None:
469471

470472
if errors:
471473
# Display all errors with their prediction indices
472-
log.error(f"💥 Found {len(errors)} error(s):")
474+
log.error(f"💥 Tests finished with {len(errors)} error(s):")
473475
for error, prediction_index in errors:
474476
prefix = "" if prediction_index is None else f"[{prediction_index}] "
475-
log.error(f"{prefix}{error}")
477+
log.error(f"* {prefix}{error}")
476478

477479
sys.exit(1)
478480

0 commit comments

Comments
 (0)