Пример #1
0
/*
 * outv -- print message taking into account verbosity level
 */
void
outv(int vlevel, const char *fmt, ...)
{
	va_list ap;

	if (outv_check(vlevel)) {
		_out_prefix();
		_out_indent();
		va_start(ap, fmt);
		vfprintf(out_fh, fmt, ap);
		va_end(ap);
	}
}
Пример #2
0
void
outv_title(int vlevel, const char *fmt, ...)
{
	va_list ap;
	if (!outv_check(vlevel))
		return;

	fprintf(out_fh, "\n");
	_out_prefix();
	_out_indent();
	va_start(ap, fmt);
	vfprintf(out_fh, fmt, ap);
	va_end(ap);
	fprintf(out_fh, ":\n");
}
Пример #3
0
/*
 * outv_field -- print field name and value in specified format
 *
 * Field name will have fixed width which can be changed by
 * out_set_column_width() function.
 * vlevel - verbosity level
 * field  - field name
 * fmt    - format form value
 */
void
outv_field(int vlevel, const char *field, const char *fmt, ...)
{
	va_list ap;

	if (outv_check(vlevel)) {
		_out_prefix();
		_out_indent();
		va_start(ap, fmt);
		fprintf(out_fh, "%-*s : ", out_column_width, field);
		vfprintf(out_fh, fmt, ap);
		fprintf(out_fh, "\n");
		va_end(ap);
	}
}