Skip to content

Commit 0d5efd7

Browse files
committed
add logging in evaluator
1 parent 6a82a95 commit 0d5efd7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

examples/rust_adaptive_sort/evaluator.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,20 @@
88
import tempfile
99
from pathlib import Path
1010
from openevolve.evaluation_result import EvaluationResult
11+
import logging
12+
logger = logging.getLogger("examples.rust_adaptive_sort.evaluator")
13+
1114

1215

1316
def evaluate(program_path: str) -> EvaluationResult:
14-
return asyncio.run(_evaluate(program_path))
17+
result = asyncio.run(_evaluate(program_path))
18+
if "error" in result.artifacts:
19+
logger.error(f"Error evaluating program: {result.artifacts['error']}")
20+
if "stderr" in result.artifacts:
21+
logger.error(f"Stderr: {result.artifacts['stderr']}")
22+
if "stdout" in result.artifacts:
23+
logger.error(f"Stdout: {result.artifacts['stdout']}")
24+
return result
1525

1626

1727
async def _evaluate(program_path: str) -> EvaluationResult:

0 commit comments

Comments
 (0)