MCPcopy Create free account
hub / github.com/PicoCreator/smol-dev-js / debugBlock

Method debugBlock

src/cli/OutputHandler.js:342–358  ·  view source on GitHub ↗

* Output the debug/trace log, only if the respective --trace flag is enabled * * @param {String|Function} log to output, inside a "---" line block * @param {Error} errObj to stack trace, if provided

(log, errObj)

Source from the content-addressed store, hash-verified

340 * @param {Error} errObj to stack trace, if provided
341 */
342 debugBlock(log, errObj) {
343 // Does nothing if trace is not enabled
344 if(!this.trace || !this.stdOutput) {
345 return;
346 }
347
348 // Normalize the input first
349 log = normalizeString(log);
350
351 // Handle stdOutput - if enabled
352 console.log( chalk.dim("--------------------------------------------------") );
353 console.log( chalk.dim(log) );
354 if( errObj ) {
355 console.log(errObj);
356 }
357 console.log( chalk.dim("--------------------------------------------------") );
358 }
359
360 //--------------
361 // Standard output

Callers

nothing calls this directly

Calls 1

normalizeStringFunction · 0.85

Tested by

no test coverage detected