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

@@ -8,6 +8,9 @@ import { ThemedText } from "@/components/ThemedText";
import { Colors } from "@/constants/Colors";
import { useResponsiveLayout } from "@/hooks/useResponsiveLayout";
import { DeviceUtils } from "@/utils/DeviceUtils";
import Logger from '@/utils/Logger';
const logger = Logger.withTag('ResponsiveVideoCard');
interface VideoCardProps extends React.ComponentProps<typeof TouchableOpacity> {
id: string;
@@ -138,7 +141,7 @@ const ResponsiveVideoCard = forwardRef<View, VideoCardProps>(
router.replace("/");
}
} catch (error) {
console.info("Failed to delete play record:", error);
logger.info("Failed to delete play record:", error);
Alert.alert("错误", "删除观看记录失败,请重试");
}
},