Hello.
Need advice:
Is it possible analyze "debug" condition in template, obtained from instantiation place?
Like we using LINE ?
For example, i have template for logging:
void logf(string func = __FUNCTION__, int line = __LINE__, A...)(string fmt, A args)
{
// here i want analyze, if debug == func
// and writef conditionally
writefln("%s:%d " ~ fmt, func, line, args);
}
And i want switch on logging for one function module1.func(),
then i declare in module1
debug = func1; // enable logging for func1
void func1()
{
...
logf("var1=%d", var1);
...
}
And i want to check in logf()() template: is debug condition equal function name, which instantiate logf() template.
Just advise me direction or proper keyword ...
Thanks.