Skip to content

fix: replace print() with debugPrint() in SWOCScreen and LinuxFoundation#471

Closed
adityashirsatrao007 wants to merge 1 commit into
andoriyaprashant:mainfrom
adityashirsatrao007:fix/remove-print-swoc-linux
Closed

fix: replace print() with debugPrint() in SWOCScreen and LinuxFoundation#471
adityashirsatrao007 wants to merge 1 commit into
andoriyaprashant:mainfrom
adityashirsatrao007:fix/remove-print-swoc-linux

Conversation

@adityashirsatrao007

Copy link
Copy Markdown
Contributor

Description

Removes or replaces debug print() statements in two program screens.

Problem

Both screens used bare print() statements that run in production:

social_winter_of_code.dart_loadProjects() method:

print('Loaded projects from $path: ${list.length}');  // runs for every JSON file loaded
print('Error: JSON data is null or empty in $path');
print('Error loading projects from $path: $e');

linux_foundation.dart — bookmark toggle & search callbacks:

print("Adding");     // runs on every bookmark add
print("Deleting");   // runs on every bookmark remove
print("value is $value");  // runs on every search submit

Fix

  • SWoC: Removed the success log (not needed), replaced error logs with debugPrint() (stripped in release builds automatically by Flutter)
  • Linux Foundation: Removed all 3 statements entirely (no diagnostic value)

Related Issue

Fixes #417 (Improved linting and code quality)

Type of Change

  • Bug fix (removing/replacing debug code from production)

Checklist

  • No functional changes
  • debugPrint() is Flutter's recommended replacement for print() in widget code
  • Tests pass
  • No lint warnings introduced

…creens

social_winter_of_code.dart (_loadProjects):
- Remove print() on successful project load (noisy, runs for every JSON file)
- Replace print() on empty JSON with debugPrint() (keep as warning, strip in release)
- Replace print() on load error with debugPrint() (keep for error tracing)

linux_foundation.dart:
- Remove print('Adding') before HandleBookmark.addBookmark()
- Remove print('Deleting') before HandleBookmark.deleteBookmark()
- Remove print('value is $value') in search onFieldSubmitted callback

All debug-only logs are either removed or replaced with debugPrint() which
is automatically stripped in release builds. Fixes #417.
Copilot AI review requested due to automatic review settings May 30, 2026 11:01
@netlify

netlify Bot commented May 30, 2026

Copy link
Copy Markdown

Deploy Preview for aquamarine-kheer-83feda failed. Why did it fail? →

Name Link
🔨 Latest commit 912524c
🔍 Latest deploy log https://app.netlify.com/projects/aquamarine-kheer-83feda/deploys/6a1ac37bfcfac00008bf4c98

@github-actions

Copy link
Copy Markdown

Thank you for submitting your pull request! We'll review it as soon as possible.

@adityashirsatrao007 adityashirsatrao007 closed this by deleting the head repository Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Improved linting and code quality

1 participant