]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: trace: support all source alias on -dt
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 7 Jan 2025 17:29:23 +0000 (18:29 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 10 Jan 2025 13:50:59 +0000 (14:50 +0100)
Command line argument -dt can be used to activate traces during startup.
Via its optional argument, it is possible to change settings for a
particular trace source. It is also possible to update every registered
sources by specifying an empty name.

Support the trace source alias "all". This is an alternative to the
empty name to update every sources.

src/trace.c

index 30b919df0bc2a5643db3572eed6ad50a747f89c5..55b8cdff3dab30a3333ffa0c43800fa6b3fb5c68 100644 (file)
@@ -1016,10 +1016,11 @@ int trace_parse_cmd(const char *arg_src, char **errmsg)
                          "A list can be specified as argument to configure several trace sources with comma as separator.\n"
                          "Each entry can contains the trace name, a log level and a verbosity using colon as separator.\n"
                          "Every fields are optional and can be left empty, or with a colon to specify the next one.\n\n"
-                         "An empty name will activate all registered sources.\n"
+                         "An empty name or the alias 'all' will activate all registered sources.\n"
                          "Verbosity cannot be configured in this case except 'quiet' as their values are specific to each source.\n\n"
                          "Examples:\n"
                          "-dt           activate every sources on error level\n"
+                         "-dt all:user  activate every sources on user level\n"
                          "-dt h1        activate HTTP/1 traces on error level\n"
                          "-dt h2:data   activate HTTP/2 traces on data level\n"
                          "-dt quic::clean,qmux::minimal\n    activate both QUIC transport and MUX traces on error level with their custom verbosity\n");
@@ -1060,7 +1061,7 @@ int trace_parse_cmd(const char *arg_src, char **errmsg)
                        str = NULL;
                }
 
-               if (strlen(name)) {
+               if (strlen(name) && strcmp(name, "all") != 0) {
                        src = trace_find_source(name);
                        if (!src) {
                                memprintf(errmsg, "unknown trace source '%s'", name);