va_list ap; char	buf[MAXLINE]; int	nbytes;  buf[MAXLINE-1] = EOS; va_start(ap, fmt); nbytes=vsnprintf(buf, sizeof(buf)-1, fmt, ap); va_end(ap);  if(function == NULL) { cl_log(log_level, "%s", buf); } else { cl_log(log_level, "(%s) %s", function, buf); }
va_list ap; char	buf[MAXLINE]; int	nbytes;  memset(buf, EOS, sizeof(buf)-1);  va_start(ap, fmt); nbytes=vsnprintf(buf, sizeof(buf)-1, fmt, ap); va_end(ap);  if(function == NULL) { cl_log(log_as, "[%d] %s", log_level, buf); } else { cl_log(log_as, "(%s [%d]) %s", function,log_level,buf); }
do_crm_log(int log_level, const char *function, const char *fmt, ...){	gboolean do_log = FALSE;	if(log_level < LOG_INFO) {		do_log = TRUE;	} else {		if(log_level <= crm_log_level) {			do_log = TRUE;			if(log_level != LOG_INFO) {				log_level = LOG_DEBUG;			}		}	}	if(do_log) {			va_list ap;			char	buf[MAXLINE];			int	nbytes;			buf[MAXLINE-1] = EOS;			va_start(ap, fmt);			nbytes=vsnprintf(buf, sizeof(buf)-1, fmt, ap);			va_end(ap);			if(function == NULL) {				cl_log(log_level, "%s", buf);			} else {				cl_log(log_level, "(%s) %s", function, buf);			}	}}