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

Function clusterManagerLog

app/redis-6.2.6/src/redis-cli.c:5509–5527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5507}
5508
5509static void clusterManagerLog(int level, const char* fmt, ...) {
5510 int use_colors =
5511 (config.cluster_manager_command.flags & CLUSTER_MANAGER_CMD_FLAG_COLOR);
5512 if (use_colors) {
5513 printf("\033[");
5514 switch (level) {
5515 case CLUSTER_MANAGER_LOG_LVL_INFO: printf(LOG_COLOR_BOLD); break;
5516 case CLUSTER_MANAGER_LOG_LVL_WARN: printf(LOG_COLOR_YELLOW); break;
5517 case CLUSTER_MANAGER_LOG_LVL_ERR: printf(LOG_COLOR_RED); break;
5518 case CLUSTER_MANAGER_LOG_LVL_SUCCESS: printf(LOG_COLOR_GREEN); break;
5519 default: printf(LOG_COLOR_RESET); break;
5520 }
5521 }
5522 va_list ap;
5523 va_start(ap, fmt);
5524 vprintf(fmt, ap);
5525 va_end(ap);
5526 if (use_colors) printf("\033[" LOG_COLOR_RESET);
5527}
5528
5529static void clusterManagerNodeArrayInit(clusterManagerNodeArray *array,
5530 int alloc_len)

Callers 1

Calls 2

printfFunction · 0.50
vprintfFunction · 0.50

Tested by

no test coverage detected