MCPcopy Create free account
hub / github.com/F-Stack/f-stack / moduleLogRaw

Function moduleLogRaw

app/redis-6.2.6/src/module.c:5121–5137  ·  view source on GitHub ↗

This is the low level function implementing both: * * RM_Log() * RM_LogIOError() * */

Source from the content-addressed store, hash-verified

5119 *
5120 */
5121void moduleLogRaw(RedisModule *module, const char *levelstr, const char *fmt, va_list ap) {
5122 char msg[LOG_MAX_LEN];
5123 size_t name_len;
5124 int level;
5125
5126 if (!strcasecmp(levelstr,"debug")) level = LL_DEBUG;
5127 else if (!strcasecmp(levelstr,"verbose")) level = LL_VERBOSE;
5128 else if (!strcasecmp(levelstr,"notice")) level = LL_NOTICE;
5129 else if (!strcasecmp(levelstr,"warning")) level = LL_WARNING;
5130 else level = LL_VERBOSE; /* Default. */
5131
5132 if (level < server.verbosity) return;
5133
5134 name_len = snprintf(msg, sizeof(msg),"<%s> ", module? module->name: "module");
5135 vsnprintf(msg + name_len, sizeof(msg) - name_len, fmt, ap);
5136 serverLogRaw(level,msg);
5137}
5138
5139/* Produces a log message to the standard Redis log, the format accepts
5140 * printf-alike specifiers, while level is a string describing the log

Callers 2

RM_LogFunction · 0.85
RM_LogIOErrorFunction · 0.85

Calls 4

strcasecmpFunction · 0.85
snprintfFunction · 0.85
vsnprintfFunction · 0.85
serverLogRawFunction · 0.85

Tested by

no test coverage detected