Skip to content

fix: replace print() statements with proper logging across codebase#1053

Merged
VinciGit00 merged 1 commit intoScrapeGraphAI:mainfrom
Vikrant-Khedkar:fix/replace-print-with-logging
Mar 24, 2026
Merged

fix: replace print() statements with proper logging across codebase#1053
VinciGit00 merged 1 commit intoScrapeGraphAI:mainfrom
Vikrant-Khedkar:fix/replace-print-with-logging

Conversation

@Vikrant-Khedkar
Copy link
Copy Markdown
Contributor

What does this PR do?

Replaces all raw print() statements in library code with proper logging via the existing get_logger() from
scrapegraphai/utils/logging.py.

Users can now control output verbosity with standard logging.basicConfig(level=...).

Why?

A library should not dump output to stdout via print(). Users have no way to silence, filter, or redirect it. The promotional
message in base_graph.py printed on every execute() call with no opt-out.

Changes

File Change
utils/data_export.py info, 1× warning
utils/screenshot_scraping/screenshot_preparation.py debug
graphs/speech_graph.py info
integrations/burr_bridge.py debug
graphs/abstract_graph.py info, 1× warning
graphs/base_graph.py info

Log levels

  • debug — dev artifacts, burr action tracing
  • info — export confirmations, graph results, promotional message
  • warning — missing token config fallback, empty data export

  Library code should never write directly to stdout. Migrated all 13
  print() calls to use the existing get_logger() infrastructure with
  appropriate log levels (debug/info/warning).
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 24, 2026
Copy link
Copy Markdown
Member

@lurenss lurenss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 24, 2026
@VinciGit00 VinciGit00 merged commit 7208bff into ScrapeGraphAI:main Mar 24, 2026
8 of 19 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.75.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer released on @stable size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants