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

Function serverLogHexDump

src/debug.cpp:2113–2133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2111/* ==================== Logging functions for debugging ===================== */
2112
2113void serverLogHexDump(int level, const char *descr, void *value, size_t len) {
2114 char buf[65], *b;
2115 unsigned char *v = (unsigned char*)value;
2116 char charset[] = "0123456789abcdef";
2117
2118 serverLog(level,"%s (hexdump of %zu bytes):", descr, len);
2119 b = buf;
2120 while(len) {
2121 b[0] = charset[(*v)>>4];
2122 b[1] = charset[(*v)&0xf];
2123 b[2] = '\0';
2124 b += 2;
2125 len--;
2126 v++;
2127 if (b-buf == 64 || len == 0) {
2128 serverLogRaw(level|LL_RAW,buf);
2129 b = buf;
2130 }
2131 }
2132 serverLogRaw(level|LL_RAW,"\n");
2133}
2134
2135/* =========================== Software Watchdog ============================ */
2136#include <sys/time.h>

Callers 2

hashTypeConvertZiplistFunction · 0.85
dumpCodeAroundEIPFunction · 0.85

Calls 2

serverLogFunction · 0.85
serverLogRawFunction · 0.85

Tested by

no test coverage detected