Comparing version 0.3.0 to 0.4.0
var a = require('../')('worker a') | ||
, b = require('../')('worker b'); | ||
// DEBUG=* node example/worker | ||
// DEBUG=worker:* node example/worker | ||
// DEBUG=worker:a node example/worker | ||
// DEBUG=worker:b node example/worker | ||
var a = require('../')('worker:a') | ||
, b = require('../')('worker:b'); | ||
function work() { | ||
a('doing some work'); | ||
a('doing lots of uninteresting work'); | ||
setTimeout(work, Math.random() * 1000); | ||
@@ -8,0 +13,0 @@ } |
0.4.0 / 2012-02-01 | ||
================== | ||
* Added browser variant support for older browsers [TooTallNate] | ||
* Added `debug.enable('project:*')` to browser variant [TooTallNate] | ||
* Added padding to diff (moved it to the right) | ||
0.3.0 / 2012-01-26 | ||
@@ -3,0 +10,0 @@ ================== |
/*! | ||
* debug | ||
* Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca> | ||
* Copyright(c) 2012 TJ Holowaychuk <tj@vision-media.ca> | ||
* MIT Licensed | ||
@@ -24,3 +24,3 @@ */ | ||
exports.version = '0.3.0'; | ||
exports.version = '0.4.0'; | ||
@@ -74,2 +74,15 @@ /** | ||
/** | ||
* Pad the given `str` to `len`. | ||
* | ||
* @param {String} str | ||
* @param {String} len | ||
* @return {String} | ||
* @api private | ||
*/ | ||
function pad(str, len) { | ||
return Array(Math.max(len, 1)).join(' ') + str; | ||
} | ||
/** | ||
* Create a debugger with the given `name`. | ||
@@ -96,4 +109,5 @@ * | ||
fmt = ' \033[9' + c + 'm' + name + ' ' | ||
+ '\033[3' + c + 'm+' + ms + 'ms\033[90m ' | ||
+ fmt + '\033[0m'; | ||
+ '\033[3' + c + 'm\033[90m' | ||
+ fmt + '\033[3' + c + 'm' | ||
+ ' ' + pad(ms, 40 - fmt.length) + 'ms\033[0m'; | ||
@@ -100,0 +114,0 @@ console.log.apply(this, arguments); |
{ | ||
"name": "debug" | ||
, "version": "0.3.0" | ||
, "version": "0.4.0" | ||
, "description": "small debugging utility" | ||
@@ -5,0 +5,0 @@ , "keywords": ["debug", "log", "debugger"] |
@@ -74,3 +74,3 @@ | ||
![](http://f.cl.ly/items/193R1n402g1E2c31433H/Screenshot.png) | ||
![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) | ||
@@ -77,0 +77,0 @@ When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: |
10033
13
201