Since you use C ++, you can avoid errors when using variable argument lists, which are prone to many problems:
- No argument count
- Do not check argument type
To make it more C ++, do something like:
#define EVENT_INFO(args) EventLogStream (__FILE__, __LINE__, __PRETTY_FUNCTION__) << args
and call it like (warning: all code here is pseudocode and may be syntactically incorrect, but you should get the basic idea):
EVENT_INFO ("The answer to " << the_question << " is " << answer);
An EventLogStream is similar to a cout object and, like cout, you can provide output for the class:
class Vector3D
{
EventLogStream &operator << (EventLogStream &out) { out << "{" << x << ", " << y << ", " << z << "}"; }
}