fix: add newlines to debug logging due to overlap with the progress bar
Signed-off-by: Dmytro Stanchiev <git@dmytros.dev>
This commit is contained in:
@@ -328,6 +328,7 @@ export default async function fetchKijijiItems(
|
|||||||
onRateInfo: (remaining, reset) => {
|
onRateInfo: (remaining, reset) => {
|
||||||
if (remaining && reset) {
|
if (remaining && reset) {
|
||||||
console.log(
|
console.log(
|
||||||
|
"\n" +
|
||||||
`Search - Rate limit remaining: ${remaining}, reset in: ${reset}s`,
|
`Search - Rate limit remaining: ${remaining}, reset in: ${reset}s`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -346,7 +347,7 @@ export default async function fetchKijijiItems(
|
|||||||
);
|
);
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
`Found ${listingLinks.length} listing links. Fetching details...`,
|
"\n" + `Found ${listingLinks.length} listing links. Fetching details...`,
|
||||||
);
|
);
|
||||||
|
|
||||||
const progressBar = new cliProgress.SingleBar(
|
const progressBar = new cliProgress.SingleBar(
|
||||||
@@ -364,6 +365,7 @@ export default async function fetchKijijiItems(
|
|||||||
onRateInfo: (remaining, reset) => {
|
onRateInfo: (remaining, reset) => {
|
||||||
if (remaining && reset) {
|
if (remaining && reset) {
|
||||||
console.log(
|
console.log(
|
||||||
|
"\n" +
|
||||||
`Item - Rate limit remaining: ${remaining}, reset in: ${reset}s`,
|
`Item - Rate limit remaining: ${remaining}, reset in: ${reset}s`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -375,10 +377,13 @@ export default async function fetchKijijiItems(
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof HttpError) {
|
if (err instanceof HttpError) {
|
||||||
console.error(`Failed to fetch ${link} - ${err.status} ${err.message}`);
|
console.error(
|
||||||
|
"\n" + `Failed to fetch ${link}\n - ${err.status} ${err.message}`,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
console.error(
|
||||||
`Failed to fetch ${link} - ${String((err as Error)?.message || err)}`,
|
"\n" +
|
||||||
|
`Failed to fetch ${link}\n - ${String((err as Error)?.message || err)}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user