You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
Added timestamp to debug traces (#1426)
* Added timestamp to debug traces * Make it compatible with node 0.10 and 0.12
This commit is contained in:
committed by
Ruben Bridgewater
parent
12265a5079
commit
f384e86302
@@ -4,7 +4,9 @@ var index = require('../');
|
||||
|
||||
function debug () {
|
||||
if (index.debug_mode) {
|
||||
console.error.apply(null, arguments);
|
||||
var data = Array.prototype.slice.call(arguments);
|
||||
data.unshift(new Date().toISOString());
|
||||
console.error.apply(null, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ describe("The 'blpop' method", function () {
|
||||
});
|
||||
client.rpush('blocking list', 'initial value', helper.isNumber(1));
|
||||
unhookIntercept();
|
||||
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));
|
||||
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));
|
||||
redis.debug_mode = false;
|
||||
bclient.blpop('blocking list', 0, function (err, value) {
|
||||
assert.strictEqual(value[0], 'blocking list');
|
||||
|
Reference in New Issue
Block a user