带markdown支持的调试功能:logdown
jopen
10年前
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')