Formatted diagnostic messages combine fixed text and inspected values. Check how the formatter treats objects and unused arguments.
Worked example
import * as util from "node:util";
console.log(util.format("%s: %d", "jobs", 3));Result
jobs: 3Implementation notes
Formatting happens before the message reaches its destination. Avoid including credentials or full request bodies in a diagnostic argument.
Try it yourself
Log a nested object alongside a literal percent sign.
Open the Node.js example →Editorial date September 4, 2025 · Published December 6, 2026