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

Method debug

src/cli/OutputHandler.js:319–334  ·  view source on GitHub ↗

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

(log, errObj)

Source from the content-addressed store, hash-verified

317 * @param {Error} errObj to stack trace, if provided
318 */
319 debug(log, errObj) {
320 // Does nothing if trace is not enabled
321 // or if stdOutput is not enabled
322 if(!this.trace || !this.stdOutput) {
323 return;
324 }
325
326 // Normalize the input first
327 log = normalizeString(log);
328
329 // Handle stdOutput - if enabled
330 console.log( chalk.dim(log) );
331 if( errObj ) {
332 console.log(errObj);
333 }
334 }
335
336 /**
337 * Output the debug/trace log, only if the respective --trace flag is enabled

Callers

nothing calls this directly

Calls 1

normalizeStringFunction · 0.85

Tested by

no test coverage detected