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

@@ -11,6 +11,7 @@ import {
} from "../config";
import { isBg } from "./browser";
import { newCacheReq, newTransReq } from "./req";
import { kissLog } from "./log";
const TIMEOUT = 5000;
@@ -125,7 +126,7 @@ export const fetchData = async (
const cache = await caches.open(CACHE_NAME);
res = await cache.match(cacheReq);
} catch (err) {
console.log("[cache match]", err.message);
kissLog(err, "cache match");
}
}
@@ -154,7 +155,7 @@ export const fetchData = async (
const cache = await caches.open(CACHE_NAME);
await cache.put(cacheReq, res.clone());
} catch (err) {
console.log("[cache put]", err.message);
kissLog(err, "cache put");
}
}
}