Skip to content

Commit f384e86

Browse files
ethervoidBridgeAR
authored andcommitted
Added timestamp to debug traces (#1426)
* Added timestamp to debug traces * Make it compatible with node 0.10 and 0.12
1 parent 12265a5 commit f384e86

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/debug.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ var index = require('../');
44

55
function debug () {
66
if (index.debug_mode) {
7-
console.error.apply(null, arguments);
7+
var data = Array.prototype.slice.call(arguments);
8+
data.unshift(new Date().toISOString());
9+
console.error.apply(null, data);
810
}
911
}
1012

test/commands/blpop.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe("The 'blpop' method", function () {
3131
});
3232
client.rpush('blocking list', 'initial value', helper.isNumber(1));
3333
unhookIntercept();
34-
assert(/^Send 127\.0\.0\.1:6379 id [0-9]+: \*3\r\n\$5\r\nrpush\r\n\$13\r\nblocking list\r\n\$13\r\ninitial value\r\n\n$/.test(text));
34+
assert(/Send 127\.0\.0\.1:6379 id [0-9]+: \*3\r\n\$5\r\nrpush\r\n\$13\r\nblocking list\r\n\$13\r\ninitial value\r\n\n$/.test(text));
3535
redis.debug_mode = false;
3636
bclient.blpop('blocking list', 0, function (err, value) {
3737
assert.strictEqual(value[0], 'blocking list');

0 commit comments

Comments
 (0)