Skip to content

Commit

Permalink
chore: change log level of exceptions in tasks from WARNING to `ERR…
Browse files Browse the repository at this point in the history
…OR` (#486)

* changed log level of exceptions happening in tasks from `WARNING` to `ERROR`

* Update tasks.py

* Create 486.bufix.md

* fix file name

---------

Co-authored-by: nulldomain <git@nulldoma.in>
  • Loading branch information
syncblaze and null-domain authored Nov 10, 2024
1 parent 9249806 commit bd210d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions fragments/486.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changed logging level for exceptions happening in tasks from `WARNING` to `ERROR`.
6 changes: 3 additions & 3 deletions lightbulb/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,12 @@ async def _loop(self) -> None:
n_failures += 1

if self._max_failures <= 0:
LOGGER.warning(
"Execution of tast %r failed", self._func.__name__, exc_info=(type(e), e, e.__traceback__)
LOGGER.error(
"Execution of task %r failed", self._func.__name__, exc_info=(type(e), e, e.__traceback__)
)
continue

LOGGER.warning(
LOGGER.error(
"Execution of task %r failed - cancelling after %s more failures",
self._func.__name__,
self._max_failures - n_failures,
Expand Down

0 comments on commit bd210d9

Please sign in to comment.