Skip to content

Commit

Permalink
Only log if counts are > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Jul 12, 2024
1 parent 7c056e4 commit a949887
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions img.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,12 +787,14 @@ function setupLogger(eleventyConfig, opts) {
msg.push(` (${innerMsg.join(", ")})`);
}

eleventyConfig?.logger?.logWithOptions({
message: msg.join(""),
prefix: "[11ty/eleventy-img]",
force: true,
color: "green",
});
if(optimizedCount > 0 || cachedCount > 0 || deferCount > 0) {
eleventyConfig?.logger?.logWithOptions({
message: msg.join(""),
prefix: "[11ty/eleventy-img]",
force: true,
color: "green",
});
}
});
}

Expand Down

0 comments on commit a949887

Please sign in to comment.