This looks nice, but from the example:
I found this quite confusing when I read it. The function name is vtkLogIff
and takes a condition, but it will log if the condition doesn’t hold? If so, I would call it vtkLogIfNot
or vtkLogUnless
, and maybe have a vtkLogIf
that does the opposite for those who prefer that style.
The way it is, I read vtkLogIff(INFO, ptr != nullptr, ...)
as “log if ptr is not nullptr” which is opposite to what the function seems to do.
Also, the vtkLogIff
with the extra f
(I guess for “format”) is a bit unfortunate, since I think many might read that as “if and only if”, adding even more to the confusion? EDIT: One way to avoid it is to name it vtkLogIfF
. I know it’s sort of ugly, but it does makes sense if one follows camel case and consider that the F
is short for Formatted
.
Or perhaps I’m just a confused person