From 22cda92f565d68b23faf4c471a5bf2813ecc3830 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Thu, 19 Dec 2024 15:10:28 -0600 Subject: [PATCH] A bit more tweaking on assets debug output --- src/AssetCache.js | 6 +++--- src/RemoteAssetCache.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AssetCache.js b/src/AssetCache.js index f2ea6ed..653c9b8 100644 --- a/src/AssetCache.js +++ b/src/AssetCache.js @@ -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); @@ -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); } diff --git a/src/RemoteAssetCache.js b/src/RemoteAssetCache.js index 5e35da6..0eeb615 100644 --- a/src/RemoteAssetCache.js +++ b/src/RemoteAssetCache.js @@ -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);