void logputs (enum log_options o, const char *s) { FILE *fp; FILE *warcfp; check_redirect_output (); if (o == LOG_PROGRESS) fp = get_progress_fp (); else fp = get_log_fp (); if (fp == NULL) return; warcfp = get_warc_log_fp (); CHECK_VERBOSE (o); FPUTS (s, fp); if (warcfp != NULL) FPUTS (s, warcfp); if (save_context_p) saved_append (s); if (flush_log_p) logflush (); else needs_flushing = true; }
void logputs (enum log_options o, const char *s) { FILE *fp; check_redirect_output (); if ((fp = get_log_fp ()) == NULL) return; CHECK_VERBOSE (o); FPUTS (s, fp); if (save_context_p) saved_append (s); if (flush_log_p) logflush (); else needs_flushing = true; }
void logprintf (enum log_options o, const char *fmt, ...) { va_list args; struct logvprintf_state lpstate; bool done; check_redirect_output (); if (inhibit_logging) return; CHECK_VERBOSE (o); xzero (lpstate); do { va_start (args, fmt); done = log_vprintf_internal (&lpstate, fmt, args); va_end (args); } while (!done); }
/* The same as logprintf(), but does anything only if opt.debug is true. */ void debug_logprintf (const char *fmt, ...) { if (opt.debug) { va_list args; struct logvprintf_state lpstate; bool done; check_redirect_output (); if (inhibit_logging) return; xzero (lpstate); do { va_start (args, fmt); done = log_vprintf_internal (&lpstate, fmt, args); va_end (args); } while (!done); } }