Replace raw print/debugPrint usage with structured, redacted logging

Open
#912 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #913 by @NihalDR — closed without merging
  • #921 by @Varvyju — closed without merging

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
dart

Research direction

Start by inspecting the raw calls in lib/app/utils/system_ringtone_service.dart:75, lib/app/data/providers/push_notifications.dart:8, and lib/app/modules/timer/views/timer_animation.dart:35, then search production code for other print/debugPrint usage. Define the centralized logging, redaction, and enforcement scope before changing callers. Done means production prints are removed or justified, sensitive values are redacted, the policy is enforced, and developer documentation is updated.

Written by the indexing model from the issue text.

Description

Problem

The codebase contains many raw print / debugPrint calls in production paths. This can:

  • create noisy logs that make real errors harder to triage
  • leak internal state or sensitive runtime details in logs
  • make logging behavior inconsistent across modules

Example locations

  • lib/app/utils/system_ringtone_service.dart:75
  • lib/app/data/providers/push_notifications.dart:8
  • lib/app/modules/timer/views/timer_animation.dart:35

Why this is important

Logging should follow a structured policy with controllable verbosity and redaction. Ad-hoc prints increase operational risk and reduce observability quality.

Proposed fix

  • Introduce a centralized logging utility (e.g., wrapper with levels: debug/info/warn/error)
  • Gate debug-level logs behind build mode / config
  • Redact sensitive fields (tokens, user IDs, emails, device-specific identifiers)
  • Replace raw print/debugPrint calls incrementally, starting with app logic and providers
  • Add lint or CI check to prevent new raw print statements in production code

Acceptance criteria

  • Raw print calls removed from production paths (or explicitly justified)
  • debugPrint usage follows centralized logger policy
  • Sensitive values are redacted in logs
  • Developer docs include logging guidelines
Dominant language
Dart
Stars
115
Forks
227
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CCExtractor/ultimate_alarm_clock

All issues in CCExtractor/ultimate_alarm_clock

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.