feat: replace logging with custom log_all function and truncate benchmark log on start

This commit is contained in:
2026-01-29 06:42:06 +00:00
parent 608b69e547
commit d0a17cd3c9
52 changed files with 11512 additions and 5041 deletions
+24 -18
View File
@@ -2,21 +2,27 @@ TASK: Create a dummy log file with 20 lines of mixed INFO and ERROR messages. Pa
----------------------------------------
Loading...
[Agent] Iteration 1/300
[Agent] has_tool_calls=true
[Agent] Executing 1 tool(s)
-> Writing file: dummy_log.txt
[parallel] launching write_file
[Agent] Iteration 2/300
A dummy log file named dummy_log.txt with 20 mixed INFO and ERROR messages has been created. I will now parse this file using Python to count the number of errors and save a JSON summary to log_analysis.json.
[Agent] has_tool_calls=false
[Agent] Response indicates incomplete work, auto-continuing
[Agent] Iteration 3/300
[Agent] has_tool_calls=true
[Agent] Executing 1 tool(s)
-> Executing Python code
[parallel] launching python_execute
[Agent] Iteration 4/300
The log file dummy_log.txt has been parsed, errors counted, and a JSON summary has been saved to log_analysis.json. If you need to review the summary or perform further analysis, please let me know!
[Agent] has_tool_calls=false
[Agent] Completed in 4 iteration(s)
┌─── Python Source Code ─────────────────────────────────────
│  1 | import json
│  2 | # Create dummy log file
│  3 | log_lines = [f"{'ERROR' if i % 3 == 0 else 'INFO'} message {i}" for i in range(20)]
│  4 | with open('dummy_log.txt', 'w') as f:
│  5 | for line in log_lines:
│  6 | f.write(line + '\n')
│  7 | # Parse log file to count errors
│  8 | error_count = 0
│  9 | with open('dummy_log.txt', 'r') as f:
│  10 | for line in f:
│  11 | if 'ERROR' in line:
│  12 | error_count += 1
│  13 | # Create summary
│  14 | summary = {
│  15 | "total_lines": 20,
│  16 | "error_count": error_count,
│  17 | "info_count": 20 - error_count
│  18 | }
│  19 | # Save JSON summary
│  20 | with open('log_analysis.json', 'w') as f:
│  21 | json.dump(summary, f)
└────────────────────────────────────────────────────────────
A dummy log file with 20 lines of mixed INFO and ERROR messages has been created. The log has been parsed to count the errors, and a JSON summary has been saved to 'log_analysis.json'.