Commit cf71b821 authored by antirez's avatar antirez
Browse files

Binary safe dump of object content in redisLogObjectDebugInfo().

parent b6a2878a
...@@ -390,8 +390,11 @@ void redisLogObjectDebugInfo(robj *o) { ...@@ -390,8 +390,11 @@ void redisLogObjectDebugInfo(robj *o) {
redisLog(REDIS_WARNING,"Object refcount: %d", o->refcount); redisLog(REDIS_WARNING,"Object refcount: %d", o->refcount);
if (o->type == REDIS_STRING && o->encoding == REDIS_ENCODING_RAW) { if (o->type == REDIS_STRING && o->encoding == REDIS_ENCODING_RAW) {
redisLog(REDIS_WARNING,"Object raw string len: %zu", sdslen(o->ptr)); redisLog(REDIS_WARNING,"Object raw string len: %zu", sdslen(o->ptr));
if (sdslen(o->ptr) < 4096) if (sdslen(o->ptr) < 4096) {
redisLog(REDIS_WARNING,"Object raw string content: \"%s\"", (char*)o->ptr); sds repr = sdscatrepr(sdsempty(),o->ptr,sdslen(o->ptr));
redisLog(REDIS_WARNING,"Object raw string content: %s", repr);
sdsfree(repr);
}
} else if (o->type == REDIS_LIST) { } else if (o->type == REDIS_LIST) {
redisLog(REDIS_WARNING,"List length: %d", (int) listTypeLength(o)); redisLog(REDIS_WARNING,"List length: %d", (int) listTypeLength(o));
} else if (o->type == REDIS_SET) { } else if (o->type == REDIS_SET) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment