1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-01-31 04:03:51 +01:00

Added logit on renderer

This commit is contained in:
Feenix 2023-04-30 07:14:47 +05:30
parent b1db755843
commit be1eb62a91

View File

@ -13,6 +13,7 @@ import { useAtom } from "jotai";
import { logAtom } from "../atoms/logAtom";
import { modelsListAtom } from "../atoms/modelsListAtom";
import { batchModeAtom, scaleAtom } from "../atoms/userSettingsAtom";
import useLog from "../components/hooks/useLog";
const Home = () => {
// STATES
@ -45,6 +46,8 @@ const Home = () => {
const [modelOptions, setModelOptions] = useAtom(modelsListAtom);
const [scale] = useAtom(scaleAtom);
const { logit } = useLog();
// (function () {
// let info = console.info;
@ -54,11 +57,6 @@ const Home = () => {
// };
// })();
const addToLog = (data: string) => {
console.log("🚀 => file: index.tsx:52 => data:", data);
setLogData((prevLogData) => [...prevLogData, data]);
};
// EFFECTS
useEffect(() => {
setLoaded(true);
@ -90,7 +88,7 @@ const Home = () => {
// LOG
window.electron.on(commands.LOG, (_, data: string) => {
addToLog(data);
logit(data);
});
// UPSCAYL PROGRESS
@ -99,7 +97,7 @@ const Home = () => {
setProgress(data);
}
handleErrors(data);
addToLog(data);
logit(data);
});
// FOLDER UPSCAYL PROGRESS
@ -108,7 +106,7 @@ const Home = () => {
setProgress(data);
}
handleErrors(data);
addToLog(data);
logit(data);
});
// DOUBLE UPSCAYL PROGRESS
@ -120,7 +118,7 @@ const Home = () => {
setProgress(data);
}
handleErrors(data);
addToLog(data);
logit(data);
});
// VIDEO UPSCAYL PROGRESS
@ -129,22 +127,22 @@ const Home = () => {
setProgress(data);
}
handleErrors(data);
addToLog(data);
logit(data);
});
// UPSCAYL DONE
window.electron.on(commands.UPSCAYL_DONE, (_, data: string) => {
setProgress("");
setUpscaledImagePath(data);
console.log("upscaledImagePath: ", upscaledImagePath);
addToLog(data);
logit("upscaledImagePath: ", upscaledImagePath);
logit(data);
});
// FOLDER UPSCAYL DONE
window.electron.on(commands.FOLDER_UPSCAYL_DONE, (_, data: string) => {
setProgress("");
setUpscaledBatchFolderPath(data);
addToLog(data);
logit(data);
});
// DOUBLE UPSCAYL DONE
@ -152,14 +150,14 @@ const Home = () => {
setProgress("");
setDoubleUpscaylCounter(0);
setUpscaledImagePath(data);
addToLog(data);
logit(data);
});
// VIDEO UPSCAYL DONE
window.electron.on(commands.UPSCAYL_VIDEO_DONE, (_, data: string) => {
setProgress("");
setUpscaledVideoPath(data);
addToLog(data);
logit(data);
});
// CUSTOM FOLDER LISTENER