From 2934e9ea69e256035ac58083a1faa896e321b627 Mon Sep 17 00:00:00 2001
From: Sukhtumur Narantuya <66850688+Sukhtumur@users.noreply.github.com>
Date: Fri, 5 Dec 2025 15:49:20 +0800
Subject: [PATCH] fix(backend): replace print() statements with proper logging
(#11499)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- Replace print() with logger.info() in reddit.py for login message
- Replace print() with logger.debug() in airtable/_api.py for API params
- Replace print() with logger.debug() in _manual_base.py for webhook URL
- Add logging imports and logger initialization where missing
- Update FIXME to TODO with GitHub issue reference #8537
### Changes 🏗️
### Checklist 📋
#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
- [x] test it still works
---
> [!NOTE]
> Switch `print()` to `logger.info/debug()` across Airtable, Reddit, and
manual webhook modules; add logger initialization and clarify TODO with
issue reference.
>
> - **Backend**:
> - **Airtable (`backend/blocks/airtable/_api.py`)**:
> - Replace `print(params)` with `logger.debug` in `create_base`.
> - **Reddit (`backend/blocks/reddit.py`)**:
> - Add `logging` import and `logger` initialization.
> - Replace login `print` with `logger.info` in `get_praw`.
> - **Webhooks (`backend/integrations/webhooks/_manual_base.py`)**:
> - Replace `print` with `logger.debug` in `_register_webhook` and add
`logger`.
> - Update `FIXME` to `TODO` with GitHub issue reference `#8537`.
>
> Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3add9b0fa9f8d409387050e706665c37570cad83. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).
Co-authored-by: Nicholas Tindle
Co-authored-by: Zamil Majdy
---
autogpt_platform/backend/backend/blocks/airtable/_api.py | 2 +-
autogpt_platform/backend/backend/blocks/reddit.py | 4 +++-
.../backend/backend/integrations/webhooks/_manual_base.py | 4 +++-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/autogpt_platform/backend/backend/blocks/airtable/_api.py b/autogpt_platform/backend/backend/blocks/airtable/_api.py
index a4d321d9ab..53ace72d98 100644
--- a/autogpt_platform/backend/backend/blocks/airtable/_api.py
+++ b/autogpt_platform/backend/backend/blocks/airtable/_api.py
@@ -1371,7 +1371,7 @@ async def create_base(
if tables:
params["tables"] = tables
- print(params)
+ logger.debug(f"Creating Airtable base with params: {params}")
response = await Requests().post(
"https://api.airtable.com/v0/meta/bases",
diff --git a/autogpt_platform/backend/backend/blocks/reddit.py b/autogpt_platform/backend/backend/blocks/reddit.py
index 318d719732..231e7affef 100644
--- a/autogpt_platform/backend/backend/blocks/reddit.py
+++ b/autogpt_platform/backend/backend/blocks/reddit.py
@@ -1,3 +1,4 @@
+import logging
from datetime import datetime, timezone
from typing import Iterator, Literal
@@ -64,6 +65,7 @@ class RedditComment(BaseModel):
settings = Settings()
+logger = logging.getLogger(__name__)
def get_praw(creds: RedditCredentials) -> praw.Reddit:
@@ -77,7 +79,7 @@ def get_praw(creds: RedditCredentials) -> praw.Reddit:
me = client.user.me()
if not me:
raise ValueError("Invalid Reddit credentials.")
- print(f"Logged in as Reddit user: {me.name}")
+ logger.info(f"Logged in as Reddit user: {me.name}")
return client
diff --git a/autogpt_platform/backend/backend/integrations/webhooks/_manual_base.py b/autogpt_platform/backend/backend/integrations/webhooks/_manual_base.py
index cf749a3cf9..fd9eb00e2a 100644
--- a/autogpt_platform/backend/backend/integrations/webhooks/_manual_base.py
+++ b/autogpt_platform/backend/backend/integrations/webhooks/_manual_base.py
@@ -18,7 +18,9 @@ class ManualWebhookManagerBase(BaseWebhooksManager[WT]):
ingress_url: str,
secret: str,
) -> tuple[str, dict]:
- print(ingress_url) # FIXME: pass URL to user in front end
+ # TODO: pass ingress_url to user in frontend
+ # See: https://github.com/Significant-Gravitas/AutoGPT/issues/8537
+ logger.debug(f"Manual webhook registered with ingress URL: {ingress_url}")
return "", {}