void cw_log(int prio, const char *format, ...) { va_list args; char fbuf[1024]; int i; for (i=0; cw_log_writers[i]; i++){ if (cw_log_writers[i]->colored){ sprintf(fbuf, "%s%s%s: %s%s", cw_strlist_get_str(prefix_color,prio), cw_strlist_get_str(prefix,prio), cw_strlist_get_str(text_color,prio), format, cw_strlist_get_str(end_color,prio) ); } else{ sprintf(fbuf, "%s: %s", cw_strlist_get_str(prefix,prio), format ); } va_start(args, format); cw_log_writers[i]->write(prio,fbuf,args,cw_log_writers[i]); va_end(args); } }
static const char * get_dbg_color_ontext(int level){ if ( ! (cw_dbg_opt_display & DBG_DISP_COLORS ) ) return ""; return cw_strlist_get_str(color_ontext,level); }
static const char * get_dbg_prefix(int level){ return cw_strlist_get_str(prefix,level); }