[master] f549ddd Initialise the VSC levels

Federico G. Schwindt fgsch at lodoss.net
Sat Sep 2 22:05:06 CEST 2017


commit f549dddd9177602f1e12c3929d6bb087231df055
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Sat Sep 2 20:43:34 2017 +0100

    Initialise the VSC levels

diff --git a/lib/libvarnishapi/vsc.c b/lib/libvarnishapi/vsc.c
index a10a3ea..cd933ad 100644
--- a/lib/libvarnishapi/vsc.c
+++ b/lib/libvarnishapi/vsc.c
@@ -291,7 +291,19 @@ vsc_iter_elem(struct vsm *vd, const struct vsm_fantom *fantom,
 		point.format = '?';
 	}
 
-	point.level = &level_info;
+	vt = vjsn_child(vv, "level");
+	AN(vt);
+	assert(vt->type == VJSN_STRING);
+
+	if (!strcmp(vt->value, "info"))  {
+		point.level = &level_info;
+	} else if (!strcmp(vt->value, "diag")) {
+		point.level = &level_diag;
+	} else if (!strcmp(vt->value, "debug")) {
+		point.level = &level_debug;
+	} else {
+		WRONG("Illegal level");
+	}
 
 	vt = vjsn_child(vv, "index");
 	AN(vt);



More information about the varnish-commit mailing list