]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commit
Variadic LOG macros and fewer trailing newlines
authorOliver Kurth <okurth@vmware.com>
Mon, 28 Oct 2019 23:12:39 +0000 (16:12 -0700)
committerOliver Kurth <okurth@vmware.com>
Mon, 28 Oct 2019 23:12:39 +0000 (16:12 -0700)
commitbce9759be2c09dc506b5846ecfde3e337f629313
treeea1f43c2d157b8dd39d93cd8e0190ca62bfe5777
parent0cd3c86ef2eedf3151e99323e966d35667e32c66
Variadic LOG macros and fewer trailing newlines

It's (long past) time we started using variadic LOG macros
and stopped requiring a newline at the end of every format
string.  A previous removed the newline requirement recently.

-   LOG(N, ("format string\n", arg1, arg2))
+   LOG(N, "format string", arg1, arg2)

The important parts of this change are buried in macro madness.
The key bit is the LOG_BYNAME macro, which now can be written
to be variadic.

To support both styles simultaneously, this change adds a macro
LOGLEVEL_VARIADIC which switches the definition of LOG_BYNAME to
variadic (e.g. remove extra parens).

Following this change, we can convert files to the variadic version
and set LOGLEVEL_VARIADIC.
open-vm-tools/lib/include/loglevel_defs.h