refactor(logging): implement unified Logger system to replace console calls

- Add Logger utility with tagged output and environment-based control
- Configure Babel to remove console calls in production builds
- Replace all console.* calls across stores, services, and components with Logger
- Enable development-only logging with formatted output and component tags
- Optimize production builds by eliminating all logging code
This commit is contained in:
zimplexing
2025-08-15 22:57:38 +08:00
parent 836285dbd5
commit e57466c8c1
25 changed files with 404 additions and 200 deletions

View File

@@ -9,7 +9,7 @@
"ios": "EXPO_TV=1 EXPO_USE_METRO_WORKSPACE_ROOT=1 expo run:ios",
"prebuild": "EXPO_TV=1 EXPO_USE_METRO_WORKSPACE_ROOT=1 expo prebuild --clean && yarn copy-config",
"copy-config": "cp -r xml/* android/app/src/*",
"build": "EXPO_TV=1 yarn prebuild && cd android && ./gradlew assembleRelease",
"build": "NODE_ENV=production EXPO_TV=1 yarn prebuild && cd android && ./gradlew assembleRelease",
"build-debug": "cd android && ./gradlew assembleDebug",
"test": "jest --watchAll",
"test-ci": "jest --ci --coverage --no-cache",
@@ -67,6 +67,7 @@
"@types/jest": "^29.5.12",
"@types/react": "~18.2.45",
"@types/react-test-renderer": "^18.0.7",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^8.57.0",
"eslint-config-expo": "~7.1.2",
"jest": "^29.2.1",