]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: tools: make fddebug() automatically emit the location
authorWilly Tarreau <w@1wt.eu>
Mon, 9 Dec 2024 16:40:51 +0000 (17:40 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Dec 2024 17:05:09 +0000 (18:05 +0100)
commitc3ee4e375bb90d6ded7d9ebc01e26876d9c83799
treeb67df6e37eba2493474c6335590f4dc4b29c614a
parentd6dc8120c0b13f896bf2628e611517701aff7a38
MINOR: tools: make fddebug() automatically emit the location

fddebug() is sometimes quite helpful, but annoying to use when following
a call path because it's a pain to always repeat the function name and
call place. Let's have it automatically prepend the function name, the
file name and the line number, and make its arguments optional, replacing
them by a simple LF when all absent. This way, simply placing:

    fddebug();

is sufficient to emit a location follocing "[%s@%s:%d]\n". This function
must not be used in production (and even call places with it shouldn't be
committed) and it should only be used by developers, so the simplest the
better.
include/haproxy/tools.h