Exemplo n.º 1
0
void
sharddir_err(VRT_CTX, enum VSL_tag_e tag,  const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	if (ctx->vsl)
		VSLbv(ctx->vsl, tag, fmt, ap);
	else
		VSLv(tag, 0, fmt, ap);
	va_end(ap);
}
Exemplo n.º 2
0
vmod_log(VRT_CTX, const char *fmt, ...)
{
	unsigned u;
	va_list ap;
	txt t;

	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
	va_start(ap, fmt);
	if (ctx->vsl != NULL) {
		u = WS_Reserve(ctx->ws, 0);
		t.b = ctx->ws->f;
		t.e = VRT_StringList(ctx->ws->f, u, fmt, ap);
		if (t.e != NULL) {
			assert(t.e > t.b);
			t.e--;
			VSLbt(ctx->vsl, SLT_VCL_Log, t);
		}
		WS_Release(ctx->ws, 0);
	} else
		VSLv(SLT_VCL_Log, 0, fmt, ap);
	va_end(ap);
}