On Mon, 2019-08-05 at 14:10 -0700, Andres Freund wrote: > I was thinking that it'd just store a struct ErrParam, which'd > reference > the passed value and metadata like the name (for structured log > output) and redaction category. The bigger problem I see is handling > the different types of arguments - but perhaps the answer there would > be > to just make the macro typesafe? Or have one for scalar values and > one > for pointer types?
Losing the compile-time checks for compatibility between format codes and arguments would be a shame. Are you saying there's a potential solution for that? > Doing something like this does however require not directly using > plain > sprintf. I'm personally not bothered by that, but I'd not be > surprised > if e.g. Tom saw that differently. It may be possible to still use sprintf if we translate the ErrParams into plain values first. Regards, Jeff Davis