]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: log: skip custom logformat_node name if empty
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 25 Apr 2024 07:50:14 +0000 (09:50 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 26 Apr 2024 16:39:31 +0000 (18:39 +0200)
commitd3c92a3a830c6909cc3784f879dace9627ce23e9
tree2d5f10257f09f035c4608d9447e75b5b545c92da
parentc5846000834852dc0972970e5768794fa4d97292
MINOR: log: skip custom logformat_node name if empty

Reminder:

Since 3.0-dev4, we can optionally give a name to logformat nodes:

  log-format "%(custom_name1)B %(custom_name2)[str(value)]"

But we may also optionally set the expected node type by appending
':type' after the name, type being either sint,str or bool, like this:

  log-format "%(string_as_int:sint)[str(14)]"

However, it is currently not possible to provide a type without providing
a name that is a least 1 char long. But it could be useful to provide a
type without setting a name, like this, for typecasting purposes only:

  log-format "%(:sint)[bool(true)]"

Thus in order to allow this usage, don't set node->name if node name is
not at least 1 character long. By doing so, node->name will remain NULL
and will not be considered, but the typecast setting will.
src/log.c