feat: add log function
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { CACHE_NAME } from "../config";
|
||||
import { browser } from "./browser";
|
||||
import { apiBaiduLangdetect } from "../apis";
|
||||
import { kissLog } from "./log";
|
||||
|
||||
/**
|
||||
* 清除缓存数据
|
||||
@@ -9,7 +10,7 @@ export const tryClearCaches = async () => {
|
||||
try {
|
||||
caches.delete(CACHE_NAME);
|
||||
} catch (err) {
|
||||
console.log("[clean caches]", err.message);
|
||||
kissLog(err, "clean caches");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,7 +26,7 @@ export const tryDetectLang = async (q, useRemote = false) => {
|
||||
try {
|
||||
lang = await apiBaiduLangdetect(q);
|
||||
} catch (err) {
|
||||
console.log("[detect lang remote]", err.message);
|
||||
kissLog(err, "detect lang remote");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +35,7 @@ export const tryDetectLang = async (q, useRemote = false) => {
|
||||
const res = await browser?.i18n?.detectLanguage(q);
|
||||
lang = res?.languages?.[0]?.language;
|
||||
} catch (err) {
|
||||
console.log("[detect lang local]", err.message);
|
||||
kissLog(err, "detect lang local");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user