fix: guard console logs in MMKVUtils, Utils, and ArticleScreen with __DEV__#2106
fix: guard console logs in MMKVUtils, Utils, and ArticleScreen with __DEV__#2106PARNITA-SINGH wants to merge 4 commits into
Conversation
|
Thank you @, for creating the PR and contributing to our UltimateHealth project 💗. |
❌ PR Validation FailedThis PR was marked as To resolve this, please ensure your PR description links an issue (e.g., |
|
Hi @SB2318 , I had previously commented on this issue requesting to be assigned, but it has been open for several days and the other participant appears to have been inactive for the past 4–5 days. I would also like to request that the Thank you for your time and consideration! |
Don't worry, I recheck for every PR whether they invalid or not. |
|
Hi @SB2318, the PR is ready for review and has been thoroughly checked from my end. Everything is in order, and it's ready to be merged when you have a chance. Thank you! |
PR Description
While auditing the MMKV storage layer, several
console.log/console.warn/console.errorcalls were found executing in both dev and prod builds with no guard, leaking storage keys, error types, and fallback strategy details to system logs. Most other logging in the codebase was already guarded, making this an inconsistency.Added a centralized
debugLoghelper (frontend/src/utils/debugLog.ts) that wrapsconsole.log,console.warn, andconsole.errorbehind an__DEV__check, so log output is automatically stripped from production builds by Metro's dead-code elimination.Replaced all 17 flagged unguarded console calls across:
MMKVUtils.ts(lines 48, 73, 99, 112, 129, 132, 145, 160)Utils.ts(lines 93, 101, 109, 133, 135)ArticleScreen.tsx(lines 238, 349, 390, 420)with calls to
debugLog/debugWarn/debugErroras appropriate per call site.Type of Change
Select your work-area
Fixes
#fixes1952
Add your Work Example
📷

Checklist
Undertaking