void aim_log_vcommon(aim_log_t* l, aim_log_flag_t flag, aim_ratelimiter_t* rl, uint64_t time, const char* fname, const char* file, int line, const char* fmt, va_list vargs) { const char* color = NULL; if(flag == AIM_LOG_FLAG_MSG || flag == AIM_LOG_FLAG_FATAL || aim_log_enabled(l, flag)) { if(rl == NULL || aim_ratelimiter_limit(rl, time) == 0) { if(aim_pvs_isatty(l->pvs) == 1) { if((color = aim_log_flag_color__(flag))) { aim_printf(l->pvs, color); } } aim_log_output__(l, fname, file, line, fmt, vargs); if(color) { aim_printf(l->pvs, color_reset__); } } } }
void aim_pvs_logf(void* cookie, aim_log_flag_t flag, const char* str) { const char* color = NULL; aim_pvs_t* pvs = (aim_pvs_t*)cookie; if(pvs && aim_pvs_isatty(pvs) == 1) { if((color = aim_log_flag_color__(flag))) { aim_printf(pvs, color); } } aim_printf(pvs, "%s", str); if(color) { aim_printf(pvs, color_reset__); } }