- for (i = 0; i < conf.log_color_given; i++) {
- char *arg = conf.log_color_arg[i], *p = strchr(arg, ':');
- int ll;
- if (!p)
- goto err;
- ret = get_loglevel_by_name(arg, p - arg);
- if (ret < 0)
- goto err;
- ll = ret;
- p++;
- ret = color_parse(p, log_colors[ll]);
- if (ret < 0)
- goto err;
- }
- return;
-err:
- PARA_EMERG_LOG("color syntax error, arg %d (%s)\n", i,
- conf.log_color_arg[i]);
- exit(EXIT_FAILURE);
-}
-
-/**
- * Para_server's log function.
- *
- * \param ll The log level.
- * \param fmt The format string describing the log message.
- */
-__printf_2_3 void para_log(int ll, const char* fmt,...)
-{
- va_list argp;
- FILE *fp;
- struct tm *tm;
- time_t t1;
- char *color, str[MAXLINE] = "";
-
- ll = PARA_MIN(ll, NUM_LOGLEVELS - 1);
- ll = PARA_MAX(ll, LL_DEBUG);
- if (ll < conf.loglevel_arg)