Skip to content

Commit

Permalink
A bit more tweaking on assets debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Dec 19, 2024
1 parent b641ab2 commit 22cda92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/AssetCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class AssetCache {

this.ensureDir();

debugAssets("[@11ty/eleventy-fetch] Writing to disk cache from %o", this.source);
debugAssets("[11ty/eleventy-fetch] Writing %o from %o", contentPath, this.source);

// the contents must exist before the cache metadata are saved below
fs.writeFileSync(contentPath, contents);
Expand All @@ -271,11 +271,11 @@ class AssetCache {
debug(`Fetching from cache ${contentPath}`);

if (type === "json" || type === "parsed-xml") {
debugAssets("Reading from require('%o')", contentPath);
debugAssets("[11ty/eleventy-fetch] Reading require('%o')", contentPath);
return require(contentPath);
}

debugAssets("Reading from: %o", contentPath);
debugAssets("[11ty/eleventy-fetch] Reading %o", contentPath);
return fs.readFileSync(contentPath, type !== "buffer" ? "utf8" : null);
}

Expand Down
2 changes: 1 addition & 1 deletion src/RemoteAssetCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class RemoteAssetCache extends AssetCache {

this.fetchCount++;

debugAssets("[@11ty/eleventy-fetch] Fetching: %o", this.source);
debugAssets("[11ty/eleventy-fetch] Fetching %o", this.source);

// v5: now using global (Node-native or otherwise) fetch instead of node-fetch
let response = await fetch(this.source, fetchOptions);
Expand Down

0 comments on commit 22cda92

Please sign in to comment.