sweepai / sweep

Sweep: open-source AI-powered Software Developer for small features and bug fixes.
https://sweep.dev
Other
7.45k stars 428 forks source link

Sweep: Update error logging in sweepai/core/sweep_bot.py to include traceback #1637

Open sweep-nightly[bot] opened 1 year ago

sweep-nightly[bot] commented 1 year ago

In the file sweepai/core/sweep_bot.py, there are several instances where the logger is used to log errors or warnings without including traceback. This makes it harder to debug issues as the source of the error is not clear.

For example, in the generate_subissues method, the logger is used without traceback:

logger.warning("Failed to parse! Retrying...")

This should be updated to include traceback, like so:

logger.warning(f"Failed to parse! Retrying... {traceback.format_exc()}")

Please make similar changes for all error and warning logs in the file.

Checklist - [X] `sweepai/core/sweep_bot.py` ✅ Commit [`b12c015`](https://github.com/sweepai/sweep/commit/b12c015b2c9b9d54d51d1bb995da5f8b5d5871f9)
• Update the logger call in the `generate_subissues` method to include traceback information. Change `logger.warning("Failed to parse! Retrying...")` to `logger.warning(f"Failed to parse! Retrying... {traceback.format_exc()}")`. • Identify all other logger calls in the file that do not include traceback information and update them in a similar manner.
sweep-nightly[bot] commented 1 year ago

Here's the PR! https://github.com/sweepai/sweep/pull/1638.

💎 Sweep Pro: I used GPT-4 to create this ticket. You have unlimited GPT-4 tickets. To retrigger Sweep, edit the issue.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/sweepai/sweep/blob/39f845efafe95a8c8c4d31cda6ffaa23027bb679/sweepai/core/sweep_bot.py#L1-L1020

Step 2: ⌨️ Coding


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/update-error-logging.

.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord