/* vi: set sw=4 ts=4: */
/*
 * Utility routines.
 *
 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
 *
 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
 */

#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <syslog.h>
#include "libbb.h"

int logmode = LOGMODE_STDIO;
const char *msg_eol = "\n";

void bb_verror_msg(const char *s, va_list p, const char* strerr)
{
	/* va_copy is used because it is not portable
	 * to use va_list p twice */
	va_list p2;
	va_copy(p2, p);

	if (logmode & LOGMODE_STDIO) {
		fflush(stdout);
		fprintf(stderr, "%s: ", bb_applet_name);
		vfprintf(stderr, s, p);
		if (!strerr)
			fputs(msg_eol, stderr);
		else
			fprintf(stderr, ": %s%s", strerr, msg_eol);
	}
	if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG)) {
		if (!strerr)
			vsyslog(LOG_ERR, s, p2);
		else  {
			char *msg;
			if (vasprintf(&msg, s, p2) < 0)
				bb_error_msg_and_die(bb_msg_memory_exhausted);
			syslog(LOG_ERR, "%s: %s", msg, strerr);
			free(msg);
		}
	}
	va_end(p2);
}
