Skip to content

Commit

Permalink
feat: a bit of logs
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiAlexandruParaschiv committed Aug 1, 2024
1 parent 8b18565 commit 7874f4d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/canonical/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ export async function canonicalAuditRunner(input, context) {
checks.push(...canonicalTagChecks);

if (canonicalUrl) {
log.info(`Found canonical URL: ${canonicalUrl}`);
// if (canonicalUrl && !canonicalTagChecks.some((check) => check.error)) {
// const allPages = [];
// const setsOfPages = Object.values(aggregatedPageLinks);
Expand All @@ -443,11 +444,13 @@ export async function canonicalAuditRunner(input, context) {
// const sitemapCheck = validateCanonicalInSitemap(allPages, canonicalUrl);
// checks.push(sitemapCheck);

const urlContentCheck = await validateCanonicalUrlContentsRecursive(canonicalUrl, log);
checks.push(urlContentCheck);

const urlFormatChecks = validateCanonicalUrlFormat(canonicalUrl, baseURL);
log.info(`validateCanonicalUrlFormat results for ${canonicalUrl}: ${JSON.stringify(urlFormatChecks)}`);
checks.push(...urlFormatChecks);

const urlContentCheck = await validateCanonicalUrlContentsRecursive(canonicalUrl, log);
log.info(`validateCanonicalUrlContentsRecursive result for ${canonicalUrl}: ${JSON.stringify(urlContentCheck)}`);
checks.push(urlContentCheck);
}
log.info(`Checks for URL ${url}: ${JSON.stringify(checks)}`);
return { [url]: checks };
Expand Down

0 comments on commit 7874f4d

Please sign in to comment.