帶markdown支持的調試功能:logdown

jopen 9年前發布 | 12K 次閱讀 logdown 程序調試

Logdown是一個調試功能,可運行于瀏覽器和服務器中。支持Markdown。它沒有任何依賴只有2k gzip壓縮之后。

示例: example page or in the preview below.

Preview

Browser

Server

Using

The simplest use of the library in both platforms could be done as follows:

// In the browser var logger = new Logdown({prefix: 'foo'})

If on the server, install it through npm:

npm install --save logdown

And then use it.

// In the server-side or client-side with Browserify
var Logdown = require('logdown')
var logger = new Logdown({prefix: 'foo'})

It is highly recommended to use a prefix for your instance, this way you get a nice prefixed message on console and it is possible to silence instances based on the prefix name, as we will see after.

After creating your object, you can use the regularlog,warn,infoanderrormethods as we have onconsole, but now with Markdown support.

logger.log('lorem *ipsum*')
logger.info('dolor _sit_ amet')
logger.warn('consectetur `adipiscing` elit')

項目主頁:http://www.baiduhome.net/lib/view/home/1426837657132

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!