]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEV: flags/show-sess-to-flags: add support for color output
authorWilly Tarreau <w@1wt.eu>
Wed, 10 May 2023 15:48:00 +0000 (17:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 10 May 2023 15:48:00 +0000 (17:48 +0200)
commit2fab37eaf3512f9d275338b81807edf53499cbd8
treeda84b748870fabd5635309881ecdf4ef33288f69
parentfd1047ae6eaf5fba472dfb484e7465438196a93c
DEV: flags/show-sess-to-flags: add support for color output

Highlighting a few fields helps spot them, but only if there are not too
many. What is done here is the following:
  - the first line of each stream is highlighted in white (helps find
    beginning/end in long dumps
  - fields in the form name=value where value starts with upper case
    letters are considered as a state dump (e.g. stconn state) and are
    also highlighted. This results in ~20 pairs. In this case the name
    and value use two different colors (cyan vs yellow) to further help
    find what is being looked for

This is only done when the output is a terminal or when --color=always
is passed. It's also possible to disable it with --color=never or
--no-color.
dev/flags/show-sess-to-flags.sh