[Debug] debug module
Posted answer1215
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Debug] debug module相关的知识,希望对你有一定的参考价值。
Install:
npm i debug supports-color --save
Code:
// stdout.js var debug = require(‘debug‘); var error = debug(‘app:error‘); // by default stderr is used error(‘goes to stderr!‘); var log = debug(‘app:log‘); // set this namespace to log via console.log log.log = console.log.bind(console); // don‘t forget to bind to console! log(‘goes to stdout‘); error(‘still goes to stderr!‘); // set all output to go via console.info // overrides all per-namespace log settings debug.log = console.info.bind(console); error(‘now goes to stdout via console.info‘); log(‘still goes to stdout, but via console.info now‘);
If you just run:
node ./stdout.js
Nothing will be output.
You have to run:
Apply wildcards:
以上是关于[Debug] debug module的主要内容,如果未能解决你的问题,请参考以下文章
Unity HTFramework框架(四十)Debug的性能监控
vscode debug No module named flask