Skip to content

Commit 16bdfa1

Browse files
committed
more logs
1 parent 1760290 commit 16bdfa1

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

src/containers/LoadingScreen/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const LoadingScreen = ({ onEnd }: LoadingScreenProps) => {
6565
setCurrentTask("Validating resources...");
6666
await validateResources();
6767
} catch (error) {
68-
console.error("Failed to initialize app:", error);
68+
Log.error("Failed to initialize app:", error);
6969
setCurrentTask("Failed to initialize. Please restart the application.");
7070
}
7171
};
@@ -191,7 +191,7 @@ const LoadingScreen = ({ onEnd }: LoadingScreenProps) => {
191191
await new Promise((resolve) => setTimeout(resolve, 500));
192192
await processFileChecksums(false);
193193
} catch (error) {
194-
console.error("OMP file download failed:", error);
194+
Log.error("OMP file download failed:", error);
195195
setCurrentTask(
196196
"Failed to download OMP plugin. Please check your connection."
197197
);
@@ -268,7 +268,7 @@ const LoadingScreen = ({ onEnd }: LoadingScreenProps) => {
268268
if (!currentUpdateInfo) {
269269
const response = await getUpdateInfo();
270270
if (!response.success || !response.data) {
271-
console.error("Failed to get update info");
271+
Log.error("Failed to get update info");
272272
return true; // Continue without OMP plugin
273273
}
274274
updateInfo = response.data;
@@ -358,7 +358,7 @@ const LoadingScreen = ({ onEnd }: LoadingScreenProps) => {
358358
finishLoading(isInitialLoad ? 1000 : 1);
359359
}
360360
} catch (error: any) {
361-
console.error("File checksum processing failed:", error);
361+
Log.error("File checksum processing failed:", error);
362362
invoke("log", {
363363
msg: "File checksum processing failed: " + error.toString(),
364364
});

src/containers/MainBody/ServerList/SearchBar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { useJoinServerPrompt } from "../../../states/joinServerPrompt";
1919
import { usePersistentServers, useServers } from "../../../states/servers";
2020
import { useTheme } from "../../../states/theme";
2121
import { sc } from "../../../utils/sizeScaler";
22+
import { Log } from "../../../utils/logger";
2223

2324
interface SearchBarProps {
2425
onChange: (query: string) => void;
@@ -114,7 +115,7 @@ const SearchBar = memo<SearchBarProps>(({ onChange }) => {
114115
setServer(selected);
115116
showPrompt(true);
116117
} catch (error) {
117-
console.error("Error playing selected server:", error);
118+
Log.error("Error playing selected server:", error);
118119
}
119120
}, [selected, setServer, showPrompt]);
120121

@@ -128,7 +129,7 @@ const SearchBar = memo<SearchBarProps>(({ onChange }) => {
128129
addToFavorites(selected);
129130
}
130131
} catch (error) {
131-
console.error("Error toggling favorite:", error);
132+
Log.error("Error toggling favorite:", error);
132133
}
133134
}, [selected, favorited, removeFromFavorites, addToFavorites]);
134135

@@ -152,7 +153,7 @@ const SearchBar = memo<SearchBarProps>(({ onChange }) => {
152153
try {
153154
clearRecentlyJoined();
154155
} catch (error) {
155-
console.error("Error clearing recently joined:", error);
156+
Log.error("Error clearing recently joined:", error);
156157
}
157158
}, [clearRecentlyJoined]);
158159

src/containers/MessageBox/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { images } from "../../constants/images";
1313
import { useMessageBox } from "../../states/messageModal";
1414
import { useTheme } from "../../states/theme";
1515
import { sc } from "../../utils/sizeScaler";
16+
import { Log } from "../../utils/logger";
1617

1718
const MessageBox = memo(() => {
1819
const { args, visible, hideMessageBox } = useMessageBox();
@@ -45,7 +46,7 @@ const MessageBox = memo(() => {
4546
try {
4647
button.onPress?.();
4748
} catch (error) {
48-
console.error("Error in MessageBox button handler:", error);
49+
Log.error("Error in MessageBox button handler:", error);
4950
} finally {
5051
handleClose();
5152
}

src/containers/Notification/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as Animatable from "react-native-animatable";
44
import Text from "../../components/Text";
55
import { useNotification } from "../../states/notification";
66
import { useTheme } from "../../states/theme";
7+
import { Log } from "../../utils/logger";
78

89
interface NotificationTimer {
910
autoHide: NodeJS.Timeout | null;
@@ -72,7 +73,7 @@ const Notification = memo(() => {
7273
try {
7374
onPress();
7475
} catch (error) {
75-
console.error("Error in notification press handler:", error);
76+
Log.error("Error in notification press handler:", error);
7677
}
7778
}
7879
handleClose();

0 commit comments

Comments
 (0)