Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(backend): replace print() statements with proper logging (#11499)

Sukhtumur Narantuya2934e9ea69e2
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 "", {}