Skip to content

Commit ee936f4

Browse files
committed
Adding indent to logging messages
1 parent 5369bf1 commit ee936f4

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

wiktionary_pron/scripts/lua_init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ await lua.doString(`
2828
t = {}
2929
function require(path, extension)
3030
extension = extension or 'lua'
31-
print('required '..path,'from:', debug.getinfo(2).name)
31+
print(' required '..path,'from:', debug.getinfo(2).name)
3232
table.insert(t, 'lua_modules'..string.char(92)..path)
3333
if select(2,string.gsub(path, "%.", "")) > 0 then
3434
new_path = string.gsub(path,"%.", "/",1)
@@ -47,7 +47,7 @@ await lua.doString(`
4747
4848
local text = resp:text():await()
4949
local module = load(text)()
50-
print('loaded '..path)
50+
print(' loaded '..path)
5151
return module
5252
end
5353

wiktionary_pron/scripts/utils.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,10 @@ async function sendParallelRequests(urls) {
437437
async function fetchWithCacheMultiple(urls) {
438438
const url = urls[0].split("/").slice(-2).join("/");
439439

440-
console.log("reading cache", url);
440+
console.log(" reading cache", url);
441441
const cachedResponse = await localforage.getItem(url);
442442
if (cachedResponse) {
443-
console.log("reading from cache", url);
443+
console.log(" reading from cache", url);
444444
if (cachedResponse instanceof Blob) {
445445
const response = new Response(cachedResponse);
446446
response.headers.set("X-From-Cache", "true");
@@ -449,10 +449,10 @@ async function fetchWithCacheMultiple(urls) {
449449
}
450450
const response = new Response(JSON.parse(cachedResponse));
451451
response.headers.set("X-From-Cache", "true");
452-
console.log("Returned cached string ", url);
452+
console.log(" Returned cached string ", url);
453453
return response;
454454
}
455-
console.log("caching ", url);
455+
console.log(" caching ", url);
456456

457457
// const response = await fetch(url);
458458
const response = await sendParallelRequests(urls);
@@ -484,22 +484,22 @@ async function fetchWithCache(
484484
url,
485485
onProgress = (progress) => console.log(`Progress: ${progress.toFixed(2)}%`),
486486
) {
487-
console.log("reading cache", url);
487+
console.log(" reading cache", url);
488488
let cachedResponse = await localforage.getItem(url);
489489
if (cachedResponse) {
490-
console.log("reading from cache", url);
490+
console.log(" reading from cache", url);
491491
if (cachedResponse instanceof Blob) {
492492
const response = new Response(cachedResponse);
493493
response.headers.set("X-From-Cache", "true");
494-
console.log("Returned cached blob ", url);
494+
console.log(" Returned cached blob ", url);
495495
return response;
496496
}
497497
const response = new Response(JSON.parse(cachedResponse));
498498
response.headers.set("X-From-Cache", "true");
499-
console.log("Returned cached string ", url);
499+
console.log(" Returned cached string ", url);
500500
return response;
501501
}
502-
console.log("caching ", url);
502+
console.log(" caching ", url);
503503
const response = await fetch(url);
504504

505505
const contentLength = response.headers.get("content-length");
@@ -540,7 +540,7 @@ async function fetchWithCache(
540540
read();
541541
})
542542
.catch((error) => {
543-
console.error("Stream reading error:", error);
543+
console.error(" Stream reading error:", error);
544544
controller.error(error);
545545
});
546546
}
@@ -685,11 +685,11 @@ async function translateWithFallback(text, sourceLang = "auto", targetLang) {
685685

686686
const translateWithFallbackWrapper = function (...args) {
687687
return translateWithFallback(...args)
688-
.then((result) => result)
689-
.catch((error) => {
690-
console.error("Translation failed:", error);
691-
throw error;
692-
});
688+
.then((result) => result)
689+
.catch((error) => {
690+
console.error("Translation failed:", error);
691+
throw error;
692+
});
693693
};
694694

695695
// Now memoize the wrapper function

0 commit comments

Comments
 (0)