This is the low level function implementing both: * * RM_Log() * RM_LogIOError() * */
| 5228 | * |
| 5229 | */ |
| 5230 | void moduleLogRaw(RedisModule *module, const char *levelstr, const char *fmt, va_list ap) { |
| 5231 | char msg[LOG_MAX_LEN]; |
| 5232 | size_t name_len; |
| 5233 | int level; |
| 5234 | |
| 5235 | if (!strcasecmp(levelstr,"debug")) level = LL_DEBUG; |
| 5236 | else if (!strcasecmp(levelstr,"verbose")) level = LL_VERBOSE; |
| 5237 | else if (!strcasecmp(levelstr,"notice")) level = LL_NOTICE; |
| 5238 | else if (!strcasecmp(levelstr,"warning")) level = LL_WARNING; |
| 5239 | else level = LL_VERBOSE; /* Default. */ |
| 5240 | |
| 5241 | if (level < cserver.verbosity) return; |
| 5242 | |
| 5243 | name_len = snprintf(msg, sizeof(msg),"<%s> ", module? module->name: "module"); |
| 5244 | vsnprintf(msg + name_len, sizeof(msg) - name_len, fmt, ap); |
| 5245 | serverLogRaw(level,msg); |
| 5246 | } |
| 5247 | |
| 5248 | /* Produces a log message to the standard Redis log, the format accepts |
| 5249 | * printf-alike specifiers, while level is a string describing the log |
no test coverage detected