From 12b6e995715af814600cc427f6cc986ad108279e Mon Sep 17 00:00:00 2001 From: Gregor Zurowski Date: Sat, 4 Oct 2025 19:09:54 +0000 Subject: [PATCH] Log tasks with logger instead of Sentry --- src/user/tasks.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/user/tasks.py b/src/user/tasks.py index cb5dc0aaa6..eeee48a634 100644 --- a/src/user/tasks.py +++ b/src/user/tasks.py @@ -1,3 +1,5 @@ +import logging + from django.apps import apps from django.core.cache import cache from django_opensearch_dsl.registries import registry @@ -5,10 +7,10 @@ from discussion.models import Vote from paper.models import Paper from researchhub.celery import QUEUE_ELASTIC_SEARCH, app -from researchhub.settings import APP_ENV from user.editor_payout_tasks import editor_daily_payout_task from user.rsc_exchange_rate_record_tasks import rsc_exchange_rate_record_tasks -from utils.sentry import log_info + +logger = logging.getLogger(__name__) @app.task @@ -96,17 +98,15 @@ def update_elastic_registry(user_id): @app.task def execute_editor_daily_payout_task(): - log_info(f"{APP_ENV}-running payout") result = editor_daily_payout_task() - log_info(f"{APP_ENV}-running payout result: {str(result)}") + logger.info(f"Completed editor_daily_payout_task with result: {str(result)}") return result @app.task def execute_rsc_exchange_rate_record_tasks(): - log_info(f"{APP_ENV}-running rsc_exchange_rate_record_tasks") result = rsc_exchange_rate_record_tasks() - log_info(f"{APP_ENV}-running rsc_exchange_rate_record_tasks result: {str(result)}") + logger.info(f"Completed rsc_exchange_rate_record_tasks with result: {str(result)}") @app.task