Skip to content

Commit 4a30add

Browse files
committed
add DEBUG LOG, to to assist test suite debugging
1 parent 1a8d7cd commit 4a30add

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/debug.c

+4
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ void debugCommand(client *c) {
290290
"CRASH-AND-RECOVER <milliseconds> -- Hard crash and restart after <milliseconds> delay.",
291291
"DIGEST -- Output a hex signature representing the current DB content.",
292292
"ERROR <string> -- Return a Redis protocol error with <string> as message. Useful for clients unit tests to simulate Redis errors.",
293+
"LOG <message> -- write message to the server log.",
293294
"HTSTATS <dbid> -- Return hash table statistics of the specified Redis database.",
294295
"HTSTATS-KEY <key> -- Like htstats but for the hash table stored as key's value.",
295296
"LOADAOF -- Flush the AOF buffers on disk and reload the AOF in memory.",
@@ -333,6 +334,9 @@ NULL
333334
} else if (!strcasecmp(c->argv[1]->ptr,"assert")) {
334335
if (c->argc >= 3) c->argv[2] = tryObjectEncoding(c->argv[2]);
335336
serverAssertWithInfo(c,c->argv[0],1 == 2);
337+
} else if (!strcasecmp(c->argv[1]->ptr,"log") && c->argc == 3) {
338+
serverLog(LL_WARNING, "DEBUG LOG: %s", (char*)c->argv[2]->ptr);
339+
addReply(c,shared.ok);
336340
} else if (!strcasecmp(c->argv[1]->ptr,"reload")) {
337341
rdbSaveInfo rsi, *rsiptr;
338342
rsiptr = rdbPopulateSaveInfo(&rsi);

0 commit comments

Comments
 (0)