]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: traces: enumerate the list of levels/verbosities when not found
authorWilly Tarreau <w@1wt.eu>
Wed, 22 May 2024 09:12:32 +0000 (11:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 May 2024 09:17:57 +0000 (11:17 +0200)
commit5b9503ed33ddee84469624219159b2a2fbf2d1c3
treecac9f3fe5ac8614298fcdf35eb065b55a3433250
parent60496e884e5220b9330a1d8b3a1218f7988c879a
MINOR: traces: enumerate the list of levels/verbosities when not found

It's quite frustrating, particularly on the command line, not to have
access to the list of available levels and verbosities when one does
not exist for a given source, because there's no easy way to find them
except by starting without and connecting to the CLI. Let's enumerate
the list of supported levels and verbosities when a name does not match.

For example:

  $ ./haproxy -db -f quic-repro.cfg -dt h2:help
  [NOTICE]   (9602) : haproxy version is 3.0-dev12-60496e-27
  [NOTICE]   (9602) : path to executable is ./haproxy
  [ALERT]    (9602) : -dt: no such trace level 'help', available levels are 'error', 'user', 'proto', 'state', 'data', and 'developer'.

  $ ./haproxy -db -f quic-repro.cfg -dt h2:user:help
  [NOTICE]   (9604) : haproxy version is 3.0-dev12-60496e-27
  [NOTICE]   (9604) : path to executable is ./haproxy
  [ALERT]    (9604) : -dt: no such trace verbosity 'help' for source 'h2', available verbosities for this source are: 'quiet', 'clean', 'minimal', 'simple', 'advanced', and 'complete'.

The same is done for the CLI where the existing help message is always
displayed when entering an invalid verbosity or level.
doc/management.txt
src/trace.c