feat: add log function

This commit is contained in:
Gabe Yuan
2024-03-19 18:07:18 +08:00
parent 1d9e9c1b7d
commit 6e927473b9
24 changed files with 76 additions and 41 deletions

View File

@@ -3,6 +3,7 @@ import FavoriteIcon from "@mui/icons-material/Favorite";
import FavoriteBorderIcon from "@mui/icons-material/FavoriteBorder";
import { useState } from "react";
import { useFavWords } from "../../hooks/FavWords";
import { kissLog } from "../../libs/log";
export default function FavBtn({ word }) {
const { favWords, toggleFav } = useFavWords();
@@ -13,7 +14,7 @@ export default function FavBtn({ word }) {
setLoading(true);
await toggleFav(word);
} catch (err) {
console.log("[set fav]", err);
kissLog(err, "set fav");
} finally {
setLoading(false);
}

View File

@@ -6,6 +6,7 @@ import { sleep, limitNumber } from "../../libs/utils";
import { isGm, isExt } from "../../libs/client";
import { MSG_OPEN_TRANBOX, DEFAULT_TRANBOX_SHORTCUT } from "../../config";
import { isMobile } from "../../libs/mobile";
import { kissLog } from "../../libs/log";
export default function Slection({
contextMenuType,
@@ -127,7 +128,7 @@ export default function Slection({
});
};
} catch (err) {
console.log("[registerMenuCommand]", err);
kissLog(err, "registerMenuCommand");
}
}, [handleTranbox, contextMenuType]);