Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Commit 60a1c3e

Browse files
authoredDec 4, 2024··
Merge pull request #15 from Flagsmith/feat/log-errors
feat: Log task run errors at ERROR level
2 parents c43af41 + d471442 commit 60a1c3e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎task_processor/processor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _run_task(task: typing.Union[Task, RecurringTask]) -> typing.Tuple[Task, Tas
9999
task_run.finished_at = timezone.now()
100100
task.mark_success()
101101
except Exception as e:
102-
logger.warning(
102+
logger.error(
103103
"Failed to execute task '%s'. Exception was: %s",
104104
task.task_identifier,
105105
str(e),

‎tests/unit/task_processor/test_unit_task_processor_processor.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ def test_run_task_runs_task_and_creates_task_run_object_when_failure(
240240

241241
assert len(caplog.records) == 3
242242

243-
warning_log = caplog.records[0]
244-
assert warning_log.levelname == "WARNING"
245-
assert warning_log.message == (
243+
log_record = caplog.records[0]
244+
assert log_record.levelname == "ERROR"
245+
assert log_record.message == (
246246
f"Failed to execute task '{task.task_identifier}'. Exception was: {msg}"
247247
)
248248

0 commit comments

Comments
 (0)
This repository has been archived.