MINOR: debug: support logging to various sinks
authorWilly Tarreau <w@1wt.eu>
Tue, 17 Dec 2019 09:07:25 +0000 (10:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Dec 2019 08:19:13 +0000 (09:19 +0100)
commit0851fd5eef89c790f18b996093111fe00c840bd6
tree127846f624dbb572a0a1ff740040819178b1d899
parentba22e901b3c6e8150b22e6129698785e149bfd18
MINOR: debug: support logging to various sinks

As discussed in the thread below [1], the debug converter is currently
not of much use given that it's only built when DEBUG_EXPR is set, and
it is limited to stderr only.

This patch changes this to make it take an optional prefix and an optional
target sink so that it can log to stdout, stderr or a ring buffer. The
default output is the "buf0" ring buffer, that can be consulted from the
CLI.

[1] https://www.mail-archive.com/haproxy@formilux.org/msg35671.html

Note: if this patch is backported, it also requires the following commit to
work: 46dfd78cbf ("BUG/MINOR: sample: always check converters' arguments").
doc/configuration.txt
src/sample.c