π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Improve log
Manav Rathi7dccdecff3f5
diff --git a/desktop/src/main/log.ts b/desktop/src/main/log.tsindex 0e504115c1..04ecb6ea3b 100644--- a/desktop/src/main/log.ts+++ b/desktop/src/main/log.ts@@ -64,7 +64,10 @@ const logInfo = (...params: any[]) => {};const logDebug = (param: () => any) => {- if (isDev) console.log(`[debug] ${util.inspect(param())}`);+ if (isDev) {+ const p = param();+ console.log(`[debug] ${typeof p == "string" ? p : util.inspect(p)}`);+ }};/**diff --git a/desktop/src/services/clip-service.ts b/desktop/src/services/clip-service.tsindex add37656ea..5de05e6014 100644--- a/desktop/src/services/clip-service.ts+++ b/desktop/src/services/clip-service.ts@@ -172,10 +172,9 @@ const clipImageEmbedding_ = async (jpegFilePath: string) => {};const t2 = Date.now();const results = await imageSession.run(feeds);- log.info(- `onnx image embedding time: ${Date.now() - t1} ms (prep:${- t2 - t1- } ms, extraction: ${Date.now() - t2} ms)`,+ log.debug(+ () =>+ `CLIP image embedding took ${Date.now() - t1} ms (prep: ${t2 - t1} ms, inference: ${Date.now() - t2} ms)`,);const imageEmbedding = results["output"].data; // Float32Arrayreturn normalizeEmbedding(imageEmbedding);@@ -280,10 +279,9 @@ export const clipTextEmbedding = async (text: string) => {};const t2 = Date.now();const results = await imageSession.run(feeds);- log.info(- `onnx text embedding time: ${Date.now() - t1} ms (prep:${- t2 - t1- } ms, extraction: ${Date.now() - t2} ms)`,+ log.debug(+ () =>+ `CLIP text embedding took ${Date.now() - t1} ms (prep: ${t2 - t1} ms, inference: ${Date.now() - t2} ms)`,);const textEmbedding = results["output"].data;return normalizeEmbedding(textEmbedding);