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:20:23 +0000 (09:20 +0100)
commit9d7b7b6bd80d84942f384e8352d7cc624e26b02a
tree6284846ac2543ad9f19b1cdcb9a8f4f84d55969e
parenta0a513399a7ed0b6b4a4cca5d5cb2a2b90674d46
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").
(cherry picked from commit 0851fd5eef89c790f18b996093111fe00c840bd6)
Signed-off-by: Willy Tarreau <w@1wt.eu>
doc/configuration.txt
src/sample.c