A
avasilev
Hi all,
I am upgrading a kind of small logging framework. Until now, the
interface for logging messages takes only a format string, and a
variable argument list (in a similiar way as printf()). The interface
to the code that uses the logging facilites is through macros, i.e. one
ogf the macros looks like this:
#define LOG(fmtString, ...) GlobalLogger.LogToFile(fmtString"\n",
##__VA_ARGS__)
Now I am introducing message types, filtering etc, and need to add one
more parameter to the macros. Of course I can include that parameter in
the variable argument list, but it is good the varaible argument list
to follow the format string. So my question is: Is there a way to
implement the notion of default parameter in the macros, so the new
macros are compatible with the old code that uses them. Any ideas?
Regards
Alex
I am upgrading a kind of small logging framework. Until now, the
interface for logging messages takes only a format string, and a
variable argument list (in a similiar way as printf()). The interface
to the code that uses the logging facilites is through macros, i.e. one
ogf the macros looks like this:
#define LOG(fmtString, ...) GlobalLogger.LogToFile(fmtString"\n",
##__VA_ARGS__)
Now I am introducing message types, filtering etc, and need to add one
more parameter to the macros. Of course I can include that parameter in
the variable argument list, but it is good the varaible argument list
to follow the format string. So my question is: Is there a way to
implement the notion of default parameter in the macros, so the new
macros are compatible with the old code that uses them. Any ideas?
Regards
Alex