node.js中的console.trace方法使用說明
更新時間:2014年12月09日 09:17:37 投稿:junjie
這篇文章主要介紹了node.js中的console.trace方法使用說明,本文介紹了console.trace的方法說明、語法、接收參數(shù)、使用實例和實現(xiàn)源碼,需要的朋友可以參考下
方法說明:
向標準錯誤流輸出當前的調(diào)用棧。
語法:
復制代碼 代碼如下:
console.trace(label)
接收參數(shù):
label
例子:
復制代碼 代碼如下:
console.trace();
//運行結(jié)果:
Trace:
at Object.<anonymous> (/home/byvoid/consoletrace.js : 1: 71)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
源碼:
復制代碼 代碼如下:
Console.prototype.trace = function() {
// TODO probably can to do this better with V8's debug object once that is
// exposed.
var err = new Error;
err.name = 'Trace';
err.message = util.format.apply(this, arguments);
Error.captureStackTrace(err, arguments.callee);
this.error(err.stack);
};
您可能感興趣的文章:
- Node.js API詳解之 util模塊用法實例分析
- Node.js API詳解之 timer模塊用法實例分析
- Node.js API詳解之 os模塊用法實例分析
- Node.js API詳解之 querystring用法實例分析
- node.js中的console.log方法使用說明
- node.js中的console用法總結(jié)
- Node.js利用console輸出日志文件的方法示例
- node.js中的console.info方法使用說明
- node.js中的console.error方法使用說明
- node.js中的console.warn方法使用說明
- Node.js console控制臺簡單用法分析
- Node.js API詳解之 console模塊用法詳解
相關(guān)文章
nodejs對項目下所有空文件夾創(chuàng)建gitkeep的方法
這篇文章主要介紹了nodejs對項目下所有空文件夾創(chuàng)建gitkeep的方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2019-08-08
詳解express使用vue-router的history踩坑
這篇文章主要介紹了express 使用 vue-router 的 history 踩坑,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2019-06-06
node.js 微信開發(fā)之定時獲取access_token
本文給大家分享的是在使用node.js做微信開發(fā)的過程中如何定時獲取access_token的方法,有需要的小伙伴可以參考下2020-02-02

