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

@@ -3,13 +3,16 @@ import { View, Text, StyleSheet, Modal, FlatList } from "react-native";
import { StyledButton } from "./StyledButton";
import useDetailStore from "@/stores/detailStore";
import usePlayerStore from "@/stores/playerStore";
import Logger from '@/utils/Logger';
const logger = Logger.withTag('SourceSelectionModal');
export const SourceSelectionModal: React.FC = () => {
const { showSourceModal, setShowSourceModal, loadVideo, currentEpisodeIndex, status } = usePlayerStore();
const { searchResults, detail, setDetail } = useDetailStore();
const onSelectSource = (index: number) => {
console.log("onSelectSource", index, searchResults[index].source, detail?.source);
logger.debug("onSelectSource", index, searchResults[index].source, detail?.source);
if (searchResults[index].source !== detail?.source) {
const newDetail = searchResults[index];
setDetail(newDetail);