char	buf[20000];
char	*buf = NULL;
do_crm_log(int log_level, const char *function,	   const char *alt_debugfile, const char *fmt, ...){	int log_as = log_level;	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_as = LOG_DEBUG;		}	}	if(do_log) {		const char *cur_debugfile = NULL;		va_list ap;		char	buf[20000];		int	nbytes;				memset(buf, EOS, sizeof(buf));		va_start(ap, fmt);		nbytes=vsnprintf(buf, sizeof(buf)-1, fmt, ap);		va_end(ap);				if(alt_debugfile == NULL || nbytes < MAXLINE) {			if(alt_debugfile) {				cur_debugfile = cl_log_get_debugfile();				cl_log_set_debugfile(alt_debugfile);			}			if(function == NULL) {				cl_log(log_as, "[%d] %s", log_level, buf);			} else {				cl_log(log_as, "(%s [%d]) %s",				       function, log_level, buf);			}			if(cur_debugfile) {				cl_log_set_debugfile(cur_debugfile);			}		} else {			FILE *fp = fopen(alt_debugfile, "a");			fprintf(fp, "%s\n", buf);			fclose(fp);		}			}}