Skip to content

Commit

Permalink
fix debug logging an EleventyError incorrectly
Browse files Browse the repository at this point in the history
replace unformatted, escaped string output from util.inspect with
debug's own `%O` object pretty-print
  • Loading branch information
noelforte committed Dec 6, 2024
1 parent 43919d9 commit c8a7f32
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Errors/EleventyErrorHandler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import util from "node:util";
import debugUtil from "debug";

import ConsoleLogger from "../Util/ConsoleLogger.js";
Expand Down Expand Up @@ -77,7 +76,7 @@ class EleventyErrorHandler {
//https://nodejs.org/api/process.html
log(e, type = "log", chalkColor = "", forceToConsole = false) {
if (process.env.DEBUG) {
debug("Full error object: %o", util.inspect(e, { showHidden: false, depth: null }));
debug("Full error object: %O", e);
}

let showStack = true;
Expand Down

0 comments on commit c8a7f32

Please sign in to comment.