Varnish panic API
Poul-Henning Kamp
phk at phk.freebsd.dk
Thu Jul 2 14:16:05 CEST 2015
--------
In message <CANTn4cpDVxyimMkH9mchFRAZShx-sxCOUVYFQCLDq77pBf5UEg at mail.gmail.com>, Martin Blix Grydeland writes:
>Now that we expose the panic functions also to vmods, I believe we need to
>define a somewhat cleaner way for different parts to produce the panic
>output.
Yes, it's getting unwieldy.
A very similar situation exists in VCC with respect to the C code output.
I've been pondering extending the VSB api so that it would automatically
indent after \n.
Something like:
VSB_indent(struct vsb *, int more);
VSB_printf(vsb, "{\n");
VSB_indent(vsb, 2);
VSB_printf(vsb, "Foo = bla;\n");
VSB_indent(vsb, -2);
VSB_printf(vsb, "}\n");
As you can see from that example, the indentation needs to happen on first char *after* then \n
rather than the \n itself. I think that is the most logical and useful semantics.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the varnish-dev
mailing list