MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / logCurrentClient

Function logCurrentClient

src/debug.cpp:1826–1858  ·  view source on GitHub ↗

Log information about the "current" client, that is, the client that is * currently being served by Redis. May be NULL if Redis is not serving a * client right now. */

Source from the content-addressed store, hash-verified

1824 * currently being served by Redis. May be NULL if Redis is not serving a
1825 * client right now. */
1826void logCurrentClient(void) {
1827 if (serverTL->current_client == NULL) return;
1828
1829 client *cc = serverTL->current_client;
1830 sds client;
1831 int j;
1832
1833 serverLogRaw(LL_WARNING|LL_RAW, "\n------ CURRENT CLIENT INFO ------\n");
1834 client = catClientInfoString(sdsempty(),cc);
1835 serverLog(LL_WARNING|LL_RAW,"%s\n", client);
1836 sdsfree(client);
1837 for (j = 0; j < cc->argc; j++) {
1838 robj *decoded;
1839
1840 decoded = getDecodedObject(cc->argv[j]);
1841 serverLog(LL_WARNING|LL_RAW,"argv[%d]: '%s'\n", j,
1842 (char*)ptrFromObj(decoded));
1843 decrRefCount(decoded);
1844 }
1845 /* Check if the first argument, usually a key, is found inside the
1846 * selected DB, and if so print info about the associated object. */
1847 if (cc->argc > 1) {
1848 robj *val, *key;
1849
1850 key = getDecodedObject(cc->argv[1]);
1851 val = cc->db->find(key);
1852 if (val) {
1853 serverLog(LL_WARNING,"key '%s' found in DB containing the following object:", (char*)ptrFromObj(key));
1854 serverLogObjectDebugInfo(val);
1855 }
1856 decrRefCount(key);
1857 }
1858}
1859
1860#if defined(HAVE_PROC_MAPS)
1861

Callers 1

printCrashReportFunction · 0.85

Calls 10

serverLogRawFunction · 0.85
catClientInfoStringFunction · 0.85
sdsemptyFunction · 0.85
serverLogFunction · 0.85
sdsfreeFunction · 0.85
getDecodedObjectFunction · 0.85
ptrFromObjFunction · 0.85
decrRefCountFunction · 0.85
serverLogObjectDebugInfoFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected